svn commit: samba r15830 - in branches/SAMBA_4_0/source/kdc: .

tridge at samba.org tridge at samba.org
Tue May 23 05:14:06 GMT 2006


Author: tridge
Date: 2006-05-23 05:14:06 +0000 (Tue, 23 May 2006)
New Revision: 15830

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

Log:

fixed two kdc memory leaks

Modified:
   branches/SAMBA_4_0/source/kdc/hdb-ldb.c
   branches/SAMBA_4_0/source/kdc/kdc.c


Changeset:
Modified: branches/SAMBA_4_0/source/kdc/hdb-ldb.c
===================================================================
--- branches/SAMBA_4_0/source/kdc/hdb-ldb.c	2006-05-23 04:41:09 UTC (rev 15829)
+++ branches/SAMBA_4_0/source/kdc/hdb-ldb.c	2006-05-23 05:14:06 UTC (rev 15830)
@@ -799,27 +799,21 @@
 
 	if (flags & HDB_F_GET_CLIENT) {
 		ret = LDB_fetch_client(context, db, mem_ctx, principal, flags, entry_ex);
-		if (ret != HDB_ERR_NOENTRY) {
-			talloc_free(mem_ctx);
-			return ret;
-		}
+		if (ret != HDB_ERR_NOENTRY) goto done;
 	}
 	if (flags & HDB_F_GET_SERVER) {
 		ret = LDB_fetch_server(context, db, mem_ctx, principal, flags, entry_ex);
-		if (ret != HDB_ERR_NOENTRY) {
-			return ret;
-		}
+		if (ret != HDB_ERR_NOENTRY) goto done;
 		ret = LDB_fetch_krbtgt(context, db, mem_ctx, principal, flags, entry_ex);
-		if (ret != HDB_ERR_NOENTRY) {
-			return ret;
-		}
+		if (ret != HDB_ERR_NOENTRY) goto done;
 	}
 	if (flags & HDB_F_GET_KRBTGT) {
 		ret = LDB_fetch_krbtgt(context, db, mem_ctx, principal, flags, entry_ex);
-		if (ret != HDB_ERR_NOENTRY) {
-			return ret;
-		}
+		if (ret != HDB_ERR_NOENTRY) goto done;
 	}
+
+done:
+	talloc_free(mem_ctx);
 	return ret;
 }
 

Modified: branches/SAMBA_4_0/source/kdc/kdc.c
===================================================================
--- branches/SAMBA_4_0/source/kdc/kdc.c	2006-05-23 04:41:09 UTC (rev 15829)
+++ branches/SAMBA_4_0/source/kdc/kdc.c	2006-05-23 05:14:06 UTC (rev 15830)
@@ -127,7 +127,7 @@
 		return;
 	}
 
-	blob = data_blob_talloc(kdc_socket, NULL, dsize);
+	blob = data_blob_talloc(tmp_ctx, NULL, dsize);
 	if (blob.data == NULL) {
 		/* hope this is a temporary low memory condition */
 		talloc_free(tmp_ctx);



More information about the samba-cvs mailing list