diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-16 23:46:24 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-16 23:46:24 +0000 |
commit | d096a34285608f6387569831aaa84ed6007893e3 (patch) | |
tree | 1a834330d762a42bb097331bdfaed7a720c5443c /main | |
parent | 2f413191bd220e4841023b9827c5c9ddefbbd4d8 (diff) |
Merged revisions 247076 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r247076 | mmichelson | 2010-02-16 17:44:33 -0600 (Tue, 16 Feb 2010) | 12 lines
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/branches/1.6.1@247078 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c index 89ea3c749..f82c20f29 100644 --- a/main/utils.c +++ b/main/utils.c @@ -1796,6 +1796,7 @@ int __ast_str_helper(struct ast_str **buf, size_t max_len, } if (ast_str_make_space(buf, need)) { ast_verbose("failed to extend from %d to %d\n", (int)(*buf)->len, need); + va_end(aq); return AST_DYNSTR_BUILD_FAILED; } (*buf)->str[offset] = '\0'; /* Truncate the partial write. */ @@ -1804,6 +1805,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 */ |