Opened 15 years ago

Closed 15 years ago

#2980 closed defect (fixed)

[PATCH] Remove (char *) casts in ogrgeoconceptdatasource.cpp

Reported by: Even Rouault Owned by: dgrichard
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords: geoconcept
Cc: Even Rouault

Description

Didier,

In the process of fixing a small memory leak of _pszExt, I've found that the current code could potentially free const char* strings that are currently casted to char*.

I've attached a patch that removes all those unnecessary and potentially dangerous (char *) casts. I also think there was a bug in LoadFile() when testing for the extensions and CPLStrdup'ing them. I've just removed it, but that may be incorrect.

ogr_geoconcept.py still passes, but you should check that everything is still OK for you. I let you apply if you think it's appropriate.

Attachments (1)

geoconcept_cleanup_charstar_casts.patch (3.8 KB ) - added by Even Rouault 15 years ago.

Download all attachments as: .zip

Change History (5)

by Even Rouault, 15 years ago

comment:1 by dgrichard, 15 years ago

Even,

Checked patch. Ok for me. I'll commit the changes along with another on geoconcept.h raised by gcc 4.2. Do you agree ?

didier

comment:2 by dgrichard, 15 years ago

Status: newassigned

in reply to:  1 comment:3 by dgrichard, 15 years ago

Replying to dgrichard:

Even,

Checked patch. Ok for me. I'll commit the changes along with another on geoconcept.h raised by gcc 4.2. Do you agree ?

Fix is r16938 Other fix (geoconcept.h) is r16937

didier

comment:4 by dgrichard, 15 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.