Opened 12 years ago

Last modified 12 years ago

#4351 closed defect

memory leak while using function "ExecuteSQL" of class OGRDataSource — at Version 1

Reported by: startwithdp Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 1.7.0
Severity: normal Keywords: memory leak
Cc:

Description (last modified by startwithdp)

The "ExecuteSQL" function returns an OGRLayer containing the results of the query,Then I used ReleaseResultSet func to deallocate the OGRLayer memory. And I found that there was memory leaks around the where expression of the SQL statement;

Finally I found there was a bug in the "swq_select_free" function; this function doesn't free the where_expr member of the swq_select struct; The type of where_expr is also a struct--"swq_expr" which needs to be freed by function "swq_expr_free";

I added the followings to the "swq_select_free" function to fix this bug: if( select_info->where_expr!=NULL ) {

swq_expr_free(select_info->where_expr);

}

Change History (1)

comment:1 by startwithdp, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.