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

Richard Mudgett asteriskteam at digium.com
Fri Jan 20 12:31:06 CST 2017


Richard Mudgett has uploaded a new change for review. ( https://gerrit.asterisk.org/4735 )

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/35/4735/1

diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 00c2233..6a15946 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/4735
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list