1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

merge from ab

(This used to be ctdb commit 5074b6e84704e213f733cebc92c62ca135f03cd6)
This commit is contained in:
Andrew Tridgell 2006-12-20 10:32:31 +11:00
commit 9a2ca05372
2 changed files with 5 additions and 3 deletions

View File

@ -67,8 +67,8 @@ clean:
distclean: clean
rm -f *~ */*~
rm -rf bin
rm -f config.log config.status config.cache include/config.h
rm -f config.log config.status config.cache config.h
rm -f Makefile
realdistclean: distclean
rm -f configure.in include/config.h.in
rm -f configure config.h.in

View File

@ -78,6 +78,7 @@ int ctdb_ltdb_fetch(struct ctdb_context *ctdb,
rec = tdb_fetch(ctdb->ltdb, key);
if (rec.dsize < sizeof(*header)) {
/* return an initial header */
free(rec.dptr);
ltdb_initial_header(ctdb, key, header);
data->dptr = NULL;
data->dsize = 0;
@ -89,6 +90,7 @@ int ctdb_ltdb_fetch(struct ctdb_context *ctdb,
data->dsize = rec.dsize - sizeof(struct ctdb_ltdb_header);
data->dptr = talloc_memdup(ctdb, sizeof(struct ctdb_ltdb_header)+rec.dptr,
data->dsize);
free(rec.dptr);
CTDB_NO_MEMORY(ctdb, data->dptr);
return 0;
@ -106,7 +108,7 @@ int ctdb_ltdb_store(struct ctdb_context *ctdb, TDB_DATA key,
TDB_DATA rec;
int ret;
rec.dsize = sizeof(struct ctdb_ltdb_header) + data.dsize;
rec.dsize = sizeof(*header) + data.dsize;
rec.dptr = talloc_size(ctdb, rec.dsize);
CTDB_NO_MEMORY(ctdb, rec.dptr);