svn commit: samba r25933 - in branches/SAMBA_4_0/source/lib/ldb/common: .

abartlet at samba.org abartlet at samba.org
Tue Nov 13 04:31:29 GMT 2007


Author: abartlet
Date: 2007-11-13 04:31:28 +0000 (Tue, 13 Nov 2007)
New Revision: 25933

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

Log:
LDB: Don't free errstring until after the printf, in case it is one of
the arguments.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2007-11-12 17:22:12 UTC (rev 25932)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2007-11-13 04:31:28 UTC (rev 25933)
@@ -277,14 +277,16 @@
 void ldb_asprintf_errstring(struct ldb_context *ldb, const char *format, ...)
 {
 	va_list ap;
+	char *old_string = NULL;
 
 	if (ldb->err_string) {
-		talloc_free(ldb->err_string);
+		old_string = ldb->err_string;
 	}
 
 	va_start(ap, format);
 	ldb->err_string = talloc_vasprintf(ldb, format, ap);
 	va_end(ap);
+	talloc_free(old_string);
 }
 
 void ldb_reset_err_string(struct ldb_context *ldb)



More information about the samba-cvs mailing list