[Asterisk-code-review] stasis bridges.c: Fix off-nominal json memory leaks. (asterisk[13])

Corey Farrell asteriskteam at digium.com
Mon Nov 6 22:44:06 CST 2017


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/7022 )

Change subject: stasis_bridges.c: Fix off-nominal json memory leaks.
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/7022/1/main/stasis_bridges.c
File main/stasis_bridges.c:

https://gerrit.asterisk.org/#/c/7022/1/main/stasis_bridges.c@883
PS1, Line 883: 	if (!out) {
             : 		ast_json_unref(json_target);
             : 		ast_json_unref(json_transferee);
             : 		return NULL;
             : 	}
> Looking at the json pack code it does not appear to clean up any internal r
I don't think we should work around this jansson bug by potentially calling json_decref extra times.

I've written a patch that I believe will make json pack continue scanning the format string and going through the arguments to decref as needed.  It builds and the current jansson 'make check' passes.  Hopefully tomorrow I'll be able to test that it manages to steal all references in different error conditions.

Feel free to try it out if you want, https://github.com/coreyfarrell/jansson branch always-steal



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
Gerrit-Change-Number: 7022
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Tue, 07 Nov 2017 04:44:06 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171106/0768f1a4/attachment-0001.html>


More information about the asterisk-code-review mailing list