res_pjsip_session: Fix multiple leaks.
authorCorey Farrell <git@cfware.com>
Tue, 7 Nov 2017 00:01:38 +0000 (19:01 -0500)
committerCorey Farrell <git@cfware.com>
Wed, 8 Nov 2017 03:23:59 +0000 (22:23 -0500)
commitecb81ae4deebfe4eb9283eadaaa357c246072661
tree6a584c1d9876f802a0871e9e3756548c910720f8
parent3c897daabf26625933dbc498d99de24700a115d5
res_pjsip_session: Fix multiple leaks.

* Pre-initialize cloned media state vectors to final size to ensure
  vector errors cannot happen later in the clone initialization.
* Release session_media on vector replace failure in
  ast_sip_session_media_state_add.
* Release clone and media_state in ast_sip_session_refresh if we fail to
  append to the stream topology, return an error.

Change-Id: Ib5ffc9b198683fa7e9bf166d74d30c1334c23acb
res/res_pjsip_session.c