diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-16 23:44:33 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-16 23:44:33 +0000 |
commit | fe7b2347a46062eb0d5e2a0247a1f5cabdd515b7 (patch) | |
tree | 61891ce87fdddca6daede163f75da3668364c0ee /main/strings.c | |
parent | 45c06aa91d989bca383c39909b1a5ae544ed29aa (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@247076 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/strings.c')
-rw-r--r-- | main/strings.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/strings.c b/main/strings.c index fdd6bcaa8..040372449 100644 --- a/main/strings.c +++ b/main/strings.c @@ -93,6 +93,7 @@ int __ast_str_helper(struct ast_str **buf, size_t max_len, #endif ) { ast_verbose("failed to extend from %d to %d\n", (int)(*buf)->__AST_STR_LEN, need); + va_end(aq); return AST_DYNSTR_BUILD_FAILED; } (*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); continue; } + va_end(aq); break; } while (1); /* update space used, keep in mind the truncation */ |