Skip to content
Permalink
Browse files

Avoid leaking sqlite3_stmt on errors

  • Loading branch information
audun authored and nyalldawson committed May 26, 2020
1 parent 57519e9 commit dc8c3d9141ade161829218c497ec416ce42eb2b8
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -4362,6 +4362,7 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id )
errMsg = ( char * ) sqlite3_malloc( ( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
handleError( sql, errMsg, savepointId );
sqlite3_finalize( stmt );
return false;
}
}
@@ -4643,6 +4644,7 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( const QgsGeometryMap &geometry
errMsg = ( char * ) sqlite3_malloc( ( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
handleError( sql, errMsg, savepointId );
sqlite3_finalize( stmt );
return false;
}
}

0 comments on commit dc8c3d9

Please sign in to comment.
You can’t perform that action at this time.