1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

- 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)
This commit is contained in:
Andrew Tridgell 2007-04-16 10:21:44 +10:00
parent 5f592876d1
commit 34bf25e227
5 changed files with 9 additions and 4 deletions

View 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;
}

View 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;
}

View 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 {

View 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

View File

@ -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