VECTOR: Passing parameters with side effects to macros is dangerous.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 21 Jun 2018 21:39:45 +0000 (16:39 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 21 Jun 2018 22:10:52 +0000 (16:10 -0600)
commitcad50d6dbf2d666ec49fda4caa9b659d367a0dec
treeafecceea1e71952c7be9bd485c99989cf0ac47e4
parentd87631d21fb1f65f9131b31c81678a1af4b5a641
VECTOR: Passing parameters with side effects to macros is dangerous.

* Fix several instances where we were bumping a ref in the parameter and
then unrefing the object if it failed.  The way the AST_VECTOR_APPEND()
and AST_VECTOR_REPLACE() macros are implemented means if it fails the new
value was never evaluated.

Change-Id: I2847872a455b11ea7e5b7ce697c0a455a1d0ac9a
bridges/bridge_softmix.c
res/res_pjsip/pjsip_options.c
res/res_pjsip_history.c
res/res_pjsip_session.c
res/stasis/messaging.c