]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Correct double-free situation in manager output processing.
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 12 Jul 2011 22:53:53 +0000 (22:53 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 12 Jul 2011 22:53:53 +0000 (22:53 +0000)
commitfeb182f802422e7a130f04fad5cf8d1d57838924
tree9ce06acfe968d9b758d2d9547c3c4fb38327920b
parent3769e99537329fcdd0cd4d84462bf5e939b9aba4
Correct double-free situation in manager output processing.

The process_output() function calls ast_str_append() and xml_translate() on its
'out' parameter, which is a pointer to an ast_str buffer. If either of these
functions need to reallocate the ast_str so it will have more space, they will
free the existing buffer and allocate a new one, returning the address of the
new one. However, because process_output only receives a pointer to the ast_str,
not a pointer to its caller's variable holding the pointer, if the original
ast_str is freed, the caller will not know, and will continue to use it (and
later attempt to free it).

(reported by jkroon on #asterisk-dev)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/manager.c