]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
- fix includes to work in both samba4 and ctdb standalone
authorAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 00:21:44 +0000 (10:21 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 00:21:44 +0000 (10:21 +1000)
- 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)

ctdb/common/ctdb_call.c
ctdb/common/ctdb_client.c
ctdb/common/ctdb_io.c
ctdb/common/ctdb_message.c
ctdb/common/ctdb_util.c

index b03c8729edb5d59a5a42c90bd1f4eb40f650cdfa..ab5c2cce3b37b9f1cd752e109b4a4236bd96d054 100644 (file)
@@ -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;
 }
index 788f97af673c74878292a1d73da181d297636f75..3cb27a1165073914b3b4549a8c2fd536ebbd8350 100644 (file)
@@ -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;
 }
index d998540e834fb16dbb0a0f6e0ac2ba3cd26d7e51..238f1701cf8b38c2141ba42ca795b1f1c0626805 100644 (file)
@@ -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 {
index b291258b0133b6060d89bff6b68003fb9e923fb4..dba15aecb9328b2a29ced404e5cdd5f54c29fe2a 100644 (file)
@@ -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
index c09111809911e38e93acd59158538a3d5a58f7f6..2bcd6cee687360144f5bffc2e7ebf46df2a8d6df 100644 (file)
 
 #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