aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/database.cc
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2013-11-03 14:24:43 +0200
committerGravatar David Bremner <david@tethera.net>2013-11-06 17:49:46 -0400
commita95dbba1562a4685c73f86fb30380e6663cae894 (patch)
treea47c153708a83b2232acfc4285be8e8b815759fd /lib/database.cc
parent8e4e537ceefec51fc811d0be3027572a904ba38c (diff)
lib: check talloc success in compact
In line with the allocation checks all around.
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 3dfea0f4..7a8702e2 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -863,13 +863,17 @@ notmuch_database_compact (const char* path,
const char* backup_path,
notmuch_compact_status_cb_t status_cb)
{
- void *local = talloc_new (NULL);
+ void *local;
char *notmuch_path, *xapian_path, *compact_xapian_path;
char *old_xapian_path = NULL;
notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
notmuch_database_t *notmuch = NULL;
struct stat statbuf;
+ local = talloc_new (NULL);
+ if (! local)
+ return NOTMUCH_STATUS_OUT_OF_MEMORY;
+
ret = notmuch_database_open(path, NOTMUCH_DATABASE_MODE_READ_WRITE, &notmuch);
if (ret) {
goto DONE;