lib: check talloc success in compact

In line with the allocation checks all around.
This commit is contained in:
Jani Nikula 2013-11-03 14:24:43 +02:00 committed by David Bremner
parent 8e4e537cee
commit a95dbba156

View file

@ -863,13 +863,17 @@ notmuch_database_compact (const char* path,
const char* backup_path, const char* backup_path,
notmuch_compact_status_cb_t status_cb) notmuch_compact_status_cb_t status_cb)
{ {
void *local = talloc_new (NULL); void *local;
char *notmuch_path, *xapian_path, *compact_xapian_path; char *notmuch_path, *xapian_path, *compact_xapian_path;
char *old_xapian_path = NULL; char *old_xapian_path = NULL;
notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
notmuch_database_t *notmuch = NULL; notmuch_database_t *notmuch = NULL;
struct stat statbuf; 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); ret = notmuch_database_open(path, NOTMUCH_DATABASE_MODE_READ_WRITE, &notmuch);
if (ret) { if (ret) {
goto DONE; goto DONE;