[Asterisk-code-review] res pjsip pubsub: Fix multiple leaks on failure to append ve... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Tue Nov 7 14:51:06 CST 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/7083 )

Change subject: res_pjsip_pubsub: Fix multiple leaks on failure to append vectors.
......................................................................


Patch Set 1: Code-Review-1

(3 comments)

https://gerrit.asterisk.org/#/c/7083/1/res/res_pjsip_pubsub.c
File res/res_pjsip_pubsub.c:

https://gerrit.asterisk.org/#/c/7083/1/res/res_pjsip_pubsub.c@1224
PS1, Line 1224: 			ao2_cleanup(tree);
Add a note like below for why we are cleaning up tree here.  It isn't obvious.

Have to release tree here too because a ref was added to child that destroy_subscription() doesn't release.


https://gerrit.asterisk.org/#/c/7083/1/res/res_pjsip_pubsub.c@2232
PS1, Line 2232: 	if (AST_VECTOR_SIZE(&body_parts) == 0) {
              : 		return NULL;
              : 	}
Need to call
free_body_parts(&body_parts);
before returning or we leak the body_parts vector.


https://gerrit.asterisk.org/#/c/7083/1/res/res_pjsip_pubsub.c@2239
PS1, Line 2239: 	if (!rlmi_part) {
              : 		return NULL;
              : 	}
Need to call
free_body_parts(&body_parts);
before returning or we leak the body_parts vector.



-- 
To view, visit https://gerrit.asterisk.org/7083
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I68ece0073ea79667ca41eb10405f516f1d30d482
Gerrit-Change-Number: 7083
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Tue, 07 Nov 2017 20:51:06 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171107/cd3437f0/attachment.html>


More information about the asterisk-code-review mailing list