[Home]

Summary:ASTERISK-20647: [patch] Failure to cleanup SQLite3 statements during exit causes call to sqlite3_close to fail; leaks memory
Reporter:Corey Farrell (coreyfarrell)Labels:
Date Opened:2012-11-02 21:16:57Date Closed:2012-11-03 20:18:20
Priority:MinorRegression?
Status:Closed/CompleteComponents:Core/AstDB
Versions:SVN 10.9.0-digiumphones 11.0.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) astdb-sqlite3_close.patch
Description:main/db.c:
init_statements has no matching cleanup and sqlite3_close does not succeed if any prepared statements have not been finalized.
Comments:By: Corey Farrell (coreyfarrell) 2012-11-02 21:23:28.707-0500

Create clean_statements() and clean_stmt(), call clean_statements from astdb_atexit.

By: Matt Jordan (mjordan) 2012-11-03 20:02:06.243-0500

Patch looks good!

By: Matt Jordan (mjordan) 2012-11-03 20:16:03.655-0500

Well, good enough for a quick clean up :-)

You may want to take a peek at the [coding guidelines|https://wiki.asterisk.org/wiki/display/AST/Coding+Guidelines] on the Asterisk wiki (some spacing issues near the {{if}} statement, single lines in a block still require {}).  Very minor stuff, but code reviewers always appreciate it when patches adhere to the guidelines.

Thanks again for the patches - always great to get memory leaks cleaned up!