diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-11-13 04:31:28 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:45:07 +0100 |
commit | f1ec8da56dd106481b9d79f5d590ee6ba26f7a4b (patch) | |
tree | 3edff514549a0ea8915f9e8a3235adb02eb761ff /source4/lib/ldb | |
parent | d0d0a69d0b2fafafa1ab340c8a352406b07329ef (diff) | |
download | samba-f1ec8da56dd106481b9d79f5d590ee6ba26f7a4b.tar.gz samba-f1ec8da56dd106481b9d79f5d590ee6ba26f7a4b.tar.bz2 samba-f1ec8da56dd106481b9d79f5d590ee6ba26f7a4b.zip |
r25933: LDB: Don't free errstring until after the printf, in case it is one of
the arguments.
Andrew Bartlett
(This used to be commit af40b1cd88f0e932665f6fe90daae8e687a3dc0c)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/common/ldb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index 25d273f8e9..f687e152d3 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -277,14 +277,16 @@ void ldb_set_errstring(struct ldb_context *ldb, const char *err_string) 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) |