Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#3283 closed defect (worksforme)

Memory leak when calling debug version of OGRCreateCoordinateTransformation

Reported by: rayg Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 1.6.2
Severity: normal Keywords: memory, leak, OGRCreateCoordinateTransformation
Cc:

Description

The code sequence:

OGRSpatialReference refA, refB;

OGRCoordinateTransformation* pCT =

OGRCreateCoordinateTransformation(&refA, &refB);

will return NULL for pCT but memory is leaked in debug builds. I also suspect I get a memory leak when pCT is non-NULL, but need to do more tests.

Change History (2)

comment:1 by Even Rouault, 14 years ago

Resolution: worksforme
Status: newclosed

Ray,

I've tried running Valgrind on the following code against GDAL trunk (debug build) and don't see any problem. Maybe there was a leak in 1.6.X series that has been fixed.

#include "ogr_api.h"
#include "ogr_spatialref.h"

int main(int argc, char* argv[])
{
    OGRSpatialReference refA, refB;

    OGRCoordinateTransformation* pCT =

        OGRCreateCoordinateTransformation(&refA, &refB);

    OGRCleanupAll();

    return 0;
}

in reply to:  1 comment:2 by rayg, 14 years ago

I'll be upgrading to newer GDAL in a bit, so will take another look and see if I can confirm that the problem's gone (or if it's something specific to the build env).

Note: See TracTickets for help on using tickets.