diff options
author | Jani Nikula <jani@nikula.org> | 2013-11-03 14:24:44 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2013-11-07 06:46:25 -0400 |
commit | 35ca5feb28a6e52851ba61ea63478ade40991558 (patch) | |
tree | e320b231a24151e510bd60ff2eb3756a82f915ed | |
parent | a95dbba1562a4685c73f86fb30380e6663cae894 (diff) |
lib: do not leak the database in compaction
Destroy instead of close the database after compaction, and also on
error path, to not leak the database.
-rw-r--r-- | lib/database.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/database.cc b/lib/database.cc index 7a8702e2..eadf8a76 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -941,10 +941,12 @@ notmuch_database_compact (const char* path, goto DONE; } - notmuch_database_close(notmuch); - DONE: + if (notmuch) + notmuch_database_destroy (notmuch); + talloc_free(local); + return ret; } #else |