From: Andrew Tridgell Date: Mon, 16 Apr 2007 00:21:44 +0000 (+1000) Subject: - fix includes to work in both samba4 and ctdb standalone X-Git-Tag: tevent-0.9.20~348^2~2924 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34bf25e227270b7cf00d2e7e9477bb5ddff9222b;p=thirdparty%2Fsamba.git - fix includes to work in both samba4 and ctdb standalone - when we do a store_unlock the lock record becomes unlocked, so we must destroy it (or we leak memory) (This used to be ctdb commit d85955640e670dd580073da96b25fb8a10c08d18) --- diff --git a/ctdb/common/ctdb_call.c b/ctdb/common/ctdb_call.c index b03c8729edb..ab5c2cce3b3 100644 --- a/ctdb/common/ctdb_call.c +++ b/ctdb/common/ctdb_call.c @@ -796,10 +796,13 @@ int ctdb_store_unlock(struct ctdb_record_handle *rec, TDB_DATA data) ret = ctdb_ltdb_fetch(rec->ctdb_db, rec->key, &header, NULL, NULL); if (ret) { ctdb_set_error(rec->ctdb_db->ctdb, "Fetch of locally held record failed"); + talloc_free(rec); return ret; } ret = ctdb_ltdb_store(rec->ctdb_db, rec->key, &header, data); + talloc_free(rec); + return ret; } diff --git a/ctdb/common/ctdb_client.c b/ctdb/common/ctdb_client.c index 788f97af673..3cb27a11650 100644 --- a/ctdb/common/ctdb_client.c +++ b/ctdb/common/ctdb_client.c @@ -656,6 +656,7 @@ int ctdb_client_store_unlock(struct ctdb_record_handle *rec, TDB_DATA data) state = ctdb_client_store_unlock_send(rec, rec, data); res = ctdb_client_store_unlock_recv(state, rec); - return res; + talloc_free(rec); + return res; } diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index d998540e834..238f1701cf8 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -28,7 +28,7 @@ #include "system/network.h" #include "system/filesys.h" #include "../include/ctdb_private.h" -#include "ctdb.h" +#include "../include/ctdb.h" /* structures for packet queueing - see common/ctdb_io.c */ struct ctdb_partial { diff --git a/ctdb/common/ctdb_message.c b/ctdb/common/ctdb_message.c index b291258b013..dba15aecb93 100644 --- a/ctdb/common/ctdb_message.c +++ b/ctdb/common/ctdb_message.c @@ -27,7 +27,7 @@ #include "system/network.h" #include "system/filesys.h" #include "../include/ctdb_private.h" - +#include "lib/util/dlinklist.h" /* this dispatches the messages to the registered ctdb message handler diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c index c0911180991..2bcd6cee687 100644 --- a/ctdb/common/ctdb_util.c +++ b/ctdb/common/ctdb_util.c @@ -20,9 +20,10 @@ #include "includes.h" #include "lib/events/events.h" +#include "lib/tdb/include/tdb.h" #include "system/network.h" #include "system/filesys.h" -#include "ctdb_private.h" +#include "../include/ctdb_private.h" /* return error string for last error