Opened 14 years ago

Closed 17 months ago

#1104 closed defect (wontfix)

Memory Leak in OGRStyleTool::SetParamStr

Reported by: rlcave3rd@… Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: OGR_SF Version: unspecified
Severity: normal Keywords:

Description (last modified by Jukka Rahkonen)

I found this memory leak in GDAL 1.3.1, but I was not able to determine where to
apply a patch.  The string buffer created by the call to CPLStrdup in the
following statement does not seem to get freed:

sStyleValue.pszValue = CPLStrdup(pszParamString);

Here is the whole procedure for context:

void OGRStyleTool::SetParamStr(OGRStyleParamId &sStyleParam ,
                               OGRStyleValue &sStyleValue,
                               const char *pszParamString)
    sStyleValue.bValid = TRUE;
    sStyleValue.eUnit = GetUnit();
    switch (sStyleParam.eType)
        // if sStyleParam.bGeoref == TRUE , need to convert to output value;
      case OGRSTypeString:
        sStyleValue.pszValue = CPLStrdup(pszParamString);
      case OGRSTypeDouble:
        sStyleValue.dfValue = atof(pszParamString);
      case OGRSTypeInteger:
        sStyleValue.nValue  = atoi(pszParamString);
        sStyleValue.bValid = FALSE;

Change History (3)

comment:1 Changed 6 years ago by Jukka Rahkonen

Description: modified (diff)

Is this memory leak that was found from GDAL 1.3.1 perhaps fixed already?

comment:2 Changed 5 years ago by Even Rouault

Priority: highnormal

All those tickets have more than one year and nobody has acted on it, so the priority is not so high

comment:3 Changed 17 months ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to if it is not already reported there.

Note: See TracTickets for help on using tickets.