Opened 14 years ago

Closed 14 years ago

#3261 closed defect (fixed)

OGRFileOpen - double free of the datasource in case of failure

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone: 6.0 release
Component: OGR Support Version: svn-trunk (development)
Severity: normal Keywords:
Cc: warmerdam

Description

In the function OGRFileOpen, once the connection to the file/db has been established, the connection is registered in the pool. Then we try to get the to get the layer or execute the sql. If the ExecuteSQL/GetLayer fail, a call to OGR_DS_Destroy is done: but the connection is already registered in the pool and this results in a seg fault when trying to destroy (again) the datasource when msConnPoolClose is called.

Change History (3)

comment:1 by aboudreault, 14 years ago

FrankW, I suggest to remove those calls in mapogr.c and let the connection pooling handle the connection close. Do you see any problem with that ?

comment:2 by warmerdam, 14 years ago

Alan,

I agree, I think removing the OGR_DS_Destroy() call in the error exit would be appropriate, and likely replacing it with a call to release the pool connection.

comment:3 by aboudreault, 14 years ago

Resolution: fixed
Status: newclosed

Fixed and committed in r9687.

Note: See TracTickets for help on using tickets.