diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-07-10 18:38:13 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-07-23 07:18:11 +0200 |
commit | fa4a81c86b6073b2563b090aa657d8e8b63c1276 (patch) | |
tree | c789efdef717aede4bf7146031b969d9bf40401a | |
parent | 9a4a9ccda397e20b0a894541f4f1a6d24e09bf19 (diff) | |
download | samba-fa4a81c86b6073b2563b090aa657d8e8b63c1276.tar.gz samba-fa4a81c86b6073b2563b090aa657d8e8b63c1276.tar.xz samba-fa4a81c86b6073b2563b090aa657d8e8b63c1276.zip |
ctdb-vacuum: If talloc_realloc fails, terminate traverse
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | ctdb/server/ctdb_vacuum.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c index c7f052de59..491103f8c3 100644 --- a/ctdb/server/ctdb_vacuum.c +++ b/ctdb/server/ctdb_vacuum.c @@ -307,7 +307,7 @@ static int delete_marshall_traverse(void *param, void *data) recs->records = talloc_realloc_size(recs, recs->records, old_size + rec->length); if (recs->records == NULL) { DEBUG(DEBUG_ERR,(__location__ " Failed to expand\n")); - return 0; + return -1; } recs->records->count++; memcpy(old_size+(uint8_t *)(recs->records), rec, rec->length); @@ -1024,6 +1024,7 @@ static void ctdb_process_delete_list(struct ctdb_db_context *ctdb_db, if (ret != 0) { DEBUG(DEBUG_ERR, (__location__ " Error traversing the " "delete list for second marshalling.\n")); + goto done; } indata.dsize = talloc_get_size(recs->records); |