mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
r25933: LDB: Don't free errstring until after the printf, in case it is one of
the arguments. Andrew Bartlett
This commit is contained in:
committed by
Stefan Metzmacher
parent
f250ae0c36
commit
af40b1cd88
@ -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)
|
||||
|
Reference in New Issue
Block a user