[Asterisk-code-review] res pjproject.c: Fix ast strdup() alloc failure. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Wed Nov 8 07:38:46 CST 2017


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

Change subject: res_pjproject.c: Fix ast_strdup() alloc failure.
......................................................................

res_pjproject.c: Fix ast_strdup() alloc failure.

Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead
---
M res/res_pjproject.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Corey Farrell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjproject.c b/res/res_pjproject.c
index 86b2502..6137898 100644
--- a/res/res_pjproject.c
+++ b/res/res_pjproject.c
@@ -234,7 +234,7 @@
 	}
 
 	dup = ast_strdup(ast_skip_blanks(data));
-	if (AST_VECTOR_ADD_SORTED(&buildopts, dup, strcmp)) {
+	if (dup && AST_VECTOR_ADD_SORTED(&buildopts, dup, strcmp)) {
 		ast_free(dup);
 	}
 }

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead
Gerrit-Change-Number: 7089
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171108/8d41d94b/attachment.html>


More information about the asterisk-code-review mailing list