[Asterisk-code-review] CLI: Address multiple issues. (asterisk[13])

Sean Bright asteriskteam at digium.com
Tue Dec 19 12:26:44 CST 2017


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/7663 )

Change subject: CLI: Address multiple issues.
......................................................................


Patch Set 1:

(1 comment)

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

https://gerrit.asterisk.org/#/c/7663/1/main/asterisk.c@3205
PS1, Line 3205: 		/* Start with a 2049 byte buffer */
              : 		mbuf = ast_malloc(maxmbuf);
              : 
              : 		/* This will run snprintf twice at most. */
              : 		while (mbuf && (mlen = snprintf(mbuf, maxmbuf, CMD_MATCHESARRAY, lf->buffer, ptr)) > maxmbuf) {
              : 			/* Return value does not include space for NULL terminator. */
              : 			maxmbuf = mlen + 1;
              : 			ast_free(mbuf);
              : 			mbuf = ast_malloc(maxmbuf);
              : 		}
Why not use ast_vasprintf() here instead?



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I8f633ceb1714867ae30ef4e421858f77c14485a9
Gerrit-Change-Number: 7663
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Tue, 19 Dec 2017 18:26:44 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171219/d7bed32c/attachment.html>


More information about the asterisk-code-review mailing list