svn commit: samba r14030 - in branches/SAMBA_3_0/source/tdb: .

jra at samba.org jra at samba.org
Wed Mar 8 07:20:20 GMT 2006


Author: jra
Date: 2006-03-08 07:20:11 +0000 (Wed, 08 Mar 2006)
New Revision: 14030

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14030

Log:
Fix resource leak in error codepath. Coverity CID #64.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/tdb/tdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/tdb/tdb.c
===================================================================
--- branches/SAMBA_3_0/source/tdb/tdb.c	2006-03-08 07:20:10 UTC (rev 14029)
+++ branches/SAMBA_3_0/source/tdb/tdb.c	2006-03-08 07:20:11 UTC (rev 14030)
@@ -1458,10 +1458,14 @@
 					    rec.key_len))
 		    || memcmp(k, oldkey.dptr, oldkey.dsize) != 0) {
 			/* No, it wasn't: unlock it and start from scratch */
-			if (unlock_record(tdb, tdb->travlocks.off) != 0)
+			if (unlock_record(tdb, tdb->travlocks.off) != 0) {
+				SAFE_FREE(k);
 				return tdb_null;
-			if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
+			}
+			if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0) {
+				SAFE_FREE(k);
 				return tdb_null;
+			}
 			tdb->travlocks.off = 0;
 		}
 



More information about the samba-cvs mailing list