]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fixes memory leak in message API.
authorDavid Vossel <dvossel@digium.com>
Tue, 29 Nov 2011 00:00:11 +0000 (00:00 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 29 Nov 2011 00:00:11 +0000 (00:00 +0000)
commit5d452c26472da4cf155f517cf6dacef2efe11c64
treeff8be69695016e5e749f4e2d4e6e3bdcee40510b
parent4b0486b824492c9b6ab8e40b60ba50e6d5357733
Fixes memory leak in message API.

The ast_msg_get_var function did not properly decrement
the ref count of the var it retrieves.  The way this is
implemented is a bit tricky, as we must decrement the var and then
return the var's value.  As long as the documentation for the
function is followed, this will not result in a dangling pointer as
the ast_msg structure owns its own reference to the var while it
exists in the var container.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@346349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/message.h
main/message.c