[Asterisk-code-review] Ensure capath is defined on all http creations (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Feb 15 17:27:35 CST 2017


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

Change subject: Ensure capath is defined on all http creations
......................................................................


Patch Set 3: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/4960/3/main/http.c
File main/http.c:

Line 2101: 	http_tls_cfg.capath = ast_strdup("");
You need to free before setting because a reload will leak memory otherwise.

ast_free(http_tls_cfg.capath);

If you want you can also eliminate the unnecessary NULL pointer checks before ast_free() in this function because ast_free() is NULL tolerant.


PS3, Line 2326: 	ast_free(http_tls_cfg.certfile);
              : 	ast_free(http_tls_cfg.pvtfile);
Need to add a free here otherwise we will leak memory on shutdown:

ast_free(http_tls_cfg.capath);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9cbc3b6b6a8aab590f5ccde9c262a98e4d5253a1
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Elson <joshelson at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list