[asterisk-commits] res pjsip: alloca can never fail. (asterisk[14])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 23 06:37:53 CST 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/4734 )

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
  Anonymous Coward #1000019: Verified



diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index f7a4fdc..b48b8b4 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -1708,9 +1708,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/4734
To unsubscribe, visit https://gerrit.asterisk.org/settings

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



More information about the asterisk-commits mailing list