summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap_ctdb.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-03-05 12:24:35 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-03-05 12:24:35 +1100
commit41760c18bdab20d526d32568531bdf7c88272879 (patch)
treeb2f421919501a3061afe40f0cb0980f86f448ea8 /source3/lib/dbwrap_ctdb.c
parent8249383efb2037bb234dd040ebe151329cc4feb9 (diff)
parentc8ea9d1f13096cd7f51e5972915a61ca65b56ac3 (diff)
downloadsamba-41760c18bdab20d526d32568531bdf7c88272879.tar.gz
samba-41760c18bdab20d526d32568531bdf7c88272879.tar.bz2
samba-41760c18bdab20d526d32568531bdf7c88272879.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into wspp-schema
Diffstat (limited to 'source3/lib/dbwrap_ctdb.c')
-rw-r--r--source3/lib/dbwrap_ctdb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 03667ff355..4a5bf6d81a 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -121,9 +121,9 @@ static struct ctdb_marshall_buffer *db_ctdb_marshall_add(TALLOC_CTX *mem_ctx,
{
struct ctdb_rec_data *r;
size_t m_size, r_size;
- struct ctdb_marshall_buffer *m2;
+ struct ctdb_marshall_buffer *m2 = NULL;
- r = db_ctdb_marshall_record(mem_ctx, reqid, key, header, data);
+ r = db_ctdb_marshall_record(talloc_tos(), reqid, key, header, data);
if (r == NULL) {
talloc_free(m);
return NULL;
@@ -133,7 +133,7 @@ static struct ctdb_marshall_buffer *db_ctdb_marshall_add(TALLOC_CTX *mem_ctx,
m = (struct ctdb_marshall_buffer *)talloc_zero_size(
mem_ctx, offsetof(struct ctdb_marshall_buffer, data));
if (m == NULL) {
- return NULL;
+ goto done;
}
m->db_id = db_id;
}
@@ -145,15 +145,15 @@ static struct ctdb_marshall_buffer *db_ctdb_marshall_add(TALLOC_CTX *mem_ctx,
mem_ctx, m, m_size + r_size);
if (m2 == NULL) {
talloc_free(m);
- return NULL;
+ goto done;
}
memcpy(m_size + (uint8_t *)m2, r, r_size);
- talloc_free(r);
-
m2->count++;
+done:
+ talloc_free(r);
return m2;
}