[asterisk-commits] pjsip distributor.c: Add missing allocation failure check. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 12 03:46:22 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: pjsip_distributor.c: Add missing allocation failure check.
......................................................................


pjsip_distributor.c: Add missing allocation failure check.

Change-Id: I932ab2cea845e534d9ff318035b6de39972d3b28
---
M res/res_pjsip/pjsip_distributor.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, but someone else must approve



diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c
index 715ecb2..bce428e 100644
--- a/res/res_pjsip/pjsip_distributor.c
+++ b/res/res_pjsip/pjsip_distributor.c
@@ -965,7 +965,7 @@
 static void global_loaded(const char *object_type)
 {
 	char *identifier_order = ast_sip_get_endpoint_identifier_order();
-	char *io_copy = ast_strdupa(identifier_order);
+	char *io_copy = identifier_order ? ast_strdupa(identifier_order) : NULL;
 	char *identify_method;
 
 	ast_free(identifier_order);
@@ -982,6 +982,7 @@
 
 	/* Clean out the old task, if any */
 	ast_sched_clean_by_callback(prune_context, prune_task, clean_task);
+	/* Have to do something with the return value to shut up the stupid compiler. */
 	if (ast_sched_add_variable(prune_context, unidentified_prune_interval * 1000, prune_task, NULL, 1) < 0) {
 		return;
 	}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I932ab2cea845e534d9ff318035b6de39972d3b28
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list