mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Add va_end calls to __ast_str_helper.
According to the man page for stdarg(3), "Each invocation of va_copy() must be matched by a corresponding invocation of va_end() in the same function." There were several cases in __ast_str_helper where va_copy was not matched with a corresponding call to va_end. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -93,6 +93,7 @@ int __ast_str_helper(struct ast_str **buf, size_t max_len,
|
|||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
ast_verbose("failed to extend from %d to %d\n", (int)(*buf)->__AST_STR_LEN, need);
|
ast_verbose("failed to extend from %d to %d\n", (int)(*buf)->__AST_STR_LEN, need);
|
||||||
|
va_end(aq);
|
||||||
return AST_DYNSTR_BUILD_FAILED;
|
return AST_DYNSTR_BUILD_FAILED;
|
||||||
}
|
}
|
||||||
(*buf)->__AST_STR_STR[offset] = '\0'; /* Truncate the partial write. */
|
(*buf)->__AST_STR_STR[offset] = '\0'; /* Truncate the partial write. */
|
||||||
@@ -101,6 +102,7 @@ int __ast_str_helper(struct ast_str **buf, size_t max_len,
|
|||||||
va_end(aq);
|
va_end(aq);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
va_end(aq);
|
||||||
break;
|
break;
|
||||||
} while (1);
|
} while (1);
|
||||||
/* update space used, keep in mind the truncation */
|
/* update space used, keep in mind the truncation */
|
||||||
|
Reference in New Issue
Block a user