Opened 18 years ago
Last modified 18 years ago
#1103 closed defect (fixed)
Memory Leak in OGRStyleTool::GetStyleString
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
I found this memory leak in GDAL 1.3.1. Here is the patch I used (my changes are marked with ">>" in the left margin): const char *OGRStyleTool::GetStyleString( OGRStyleParamId *pasStyleParam , OGRStyleValue *pasStyleValue, int nSize) { int i; GBool bFound; char *pszCurrent = NULL; const char *pszClass; pszCurrent = (char *)CPLCalloc(nSize, 20 * sizeof(char)); <clipped for brevity> strcat(pszCurrent,")"); m_pszStyleString = CPLStrdup(pszCurrent); >> CPLFree(pszCurrent); // Fixed memory leak m_bModified = FALSE; } return m_pszStyleString; }
Note:
See TracTickets
for help on using tickets.