Opened 18 years ago

Closed 5 years 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:
Cc:

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)
{
    Parse();
    StyleModified();
    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);
        break;
      case OGRSTypeDouble:
        sStyleValue.dfValue = atof(pszParamString);
        break;
      case OGRSTypeInteger:
        sStyleValue.nValue  = atoi(pszParamString);
        break;
      default:
        sStyleValue.bValid = FALSE;
        break;
    }
}

Change History (3)

comment:1 by Jukka Rahkonen, 9 years ago

Description: modified (diff)

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

comment:2 by Even Rouault, 9 years ago

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 by Even Rouault, 5 years ago

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 https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.