[Asterisk-code-review] res pjsip: alloca can never fail. (asterisk[13])

Anonymous Coward asteriskteam at digium.com
Fri Jan 20 16:14:39 CST 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4733 )

Change subject: res_pjsip: alloca can never fail.
......................................................................


res_pjsip: alloca can never fail.

Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1
---
M res/res_pjsip/pjsip_configuration.c
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved; Verified



diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 84dfa22..8959068 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -1711,9 +1711,7 @@
 
 	if (number) {
 		print_name_len = strlen(id) + strlen(number) + 2;
-		if (!(print_name = alloca(print_name_len))) {
-			return -1;
-		}
+		print_name = ast_alloca(print_name_len);
 		snprintf(print_name, print_name_len, "%s/%s", id, number);
 	}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list