Ticket #3261 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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

Changed 3 years ago by aboudreault

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 ?

Changed 3 years ago by warmerdam

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.

Changed 3 years ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

Fixed and committed in r9687.

Note: See TracTickets for help on using tickets.