There are error paths in S3 where va_end() is not properly called after
va_start() or va_copy() have been called.
These issues were noted while performing an inspection for S4 bug #6129. Thanks
to Erik Hovland <erik@hovland.org> for the original bug report.
va_start(ap, new_fmt);
strdn = talloc_vasprintf(mem_ctx, new_fmt, ap);
+ va_end(ap);
if (strdn == NULL)
return NULL;
- va_end(ap);
dn = ldb_dn_explode(mem_ctx, strdn);
/* Format the query */
if ((p = sqlite3_vmprintf(pSql, args)) == NULL) {
+ va_end(args);
return SQLITE_NOMEM;
}
va_copy(ap2, ap);
n = vasprintf(ptr, format, ap2);
+ va_end(ap2);
if (n == -1 || ! *ptr) {
smb_panic("smb_xvasprintf: out of memory");
}
- va_end(ap2);
return n;
}