Rev 43: merge from ab in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Tue Dec 19 23:32:31 GMT 2006


------------------------------------------------------------
revno: 43
revision-id: tridge at samba.org-20061219233231-suchz62x9cgga3d2
parent: tridge at samba.org-20061219052703-70zyt2rylhthunx2
parent: ab at samba.org-20061218145829-37a4b63e49138b98
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2006-12-20 10:32:31 +1100
message:
  merge from ab
modified:
  Makefile.in                    makefile.in-20061117234101-o3qt14umlg9en8z0-1
  common/ctdb_ltdb.c             ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2
    ------------------------------------------------------------
    revno: 39.1.2
    merged: ab at samba.org-20061218145829-37a4b63e49138b98
    parent: ab at samba.org-20061218145548-5b3da7419a3d75cd
    committer: Alexander Bokovoy <ab at samba.org>
    branch nick: ctdb
    timestamp: Mon 2006-12-18 17:58:29 +0300
    message:
      Fix cleaning targets to delete proper files
    ------------------------------------------------------------
    revno: 39.1.1
    merged: ab at samba.org-20061218145548-5b3da7419a3d75cd
    parent: tridge at samba.org-20061218052657-mphl8cgp4g0zoavo
    committer: Alexander Bokovoy <ab at samba.org>
    branch nick: ctdb
    timestamp: Mon 2006-12-18 17:55:48 +0300
    message:
      Fix memory handling
=== modified file 'Makefile.in'
--- a/Makefile.in	2006-12-19 05:27:03 +0000
+++ b/Makefile.in	2006-12-19 23:32:31 +0000
@@ -67,8 +67,8 @@
 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

=== modified file 'common/ctdb_ltdb.c'
--- a/common/ctdb_ltdb.c	2006-12-18 05:01:11 +0000
+++ b/common/ctdb_ltdb.c	2006-12-19 23:32:31 +0000
@@ -78,6 +78,7 @@
 	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 @@
 	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 @@
 	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);
 



More information about the samba-cvs mailing list