mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
suunto import: give and free error message
There was a memory leak in the error case of sqlite3_exec(): The error message was not freed (and also not displayed). Display and free it. Is there a reasonable C++ version of this library? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
152e6966c9
commit
df568fbb5d
1 changed files with 4 additions and 2 deletions
|
@ -293,7 +293,8 @@ int parse_dm4_buffer(sqlite3 *handle, const char *url, const char *, int, struct
|
|||
retval = sqlite3_exec(handle, get_dives, &dm4_dive, &state, &err);
|
||||
|
||||
if (retval != SQLITE_OK) {
|
||||
report_info("Database query failed '%s'.", url);
|
||||
report_info("Database query failed '%s': %s.", url, err);
|
||||
sqlite3_free(err);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -564,7 +565,8 @@ int parse_dm5_buffer(sqlite3 *handle, const char *url, const char *, int, struct
|
|||
retval = sqlite3_exec(handle, get_dives, &dm5_dive, &state, &err);
|
||||
|
||||
if (retval != SQLITE_OK) {
|
||||
report_info("Database query failed '%s'.", url);
|
||||
report_info("Database query failed '%s': %s.", url, err);
|
||||
sqlite3_free(err);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue