]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_sip: Fix reference leaks in error paths. 62/3162/1
authorCorey Farrell <git@cfware.com>
Sat, 9 Jul 2016 18:32:27 +0000 (14:32 -0400)
committerCorey Farrell <git@cfware.com>
Sat, 9 Jul 2016 18:32:27 +0000 (14:32 -0400)
commit06ba533bc702cd5dde914b8e9473b9d26385b202
tree4142b32bd4bca623c9742b9ab137650a8680cd2e
parent8019f321290818de8be4772c8b6afaa6e9b312b2
chan_sip: Fix reference leaks in error paths.

* get_sip_pvt_from_replaces leaks sip_pvt_ptr on any error.
* build_peer leaks peer on failure to allocate the endpoint.

This patch fixes get_sip_pvt by using an RAII_VAR, build_peer is fixed
with an unref in the appropriate place.

ASTERISK-26184 #close

Change-Id: I728b424648ad041409f7d90880f4c28b3ce2ca12
channels/chan_sip.c