[Asterisk-code-review] CHAOS: cleanup possible null vars on msg alloc failure (asterisk[13])

Scott Griepentrog asteriskteam at digium.com
Wed Mar 2 11:21:17 CST 2016


Scott Griepentrog has uploaded a new change for review.

  https://gerrit.asterisk.org/2344

Change subject: CHAOS: cleanup possible null vars on msg alloc failure
......................................................................

CHAOS: cleanup possible null vars on msg alloc failure

If the string field fails to init in msg_alloc, the
vars may be null, so use a null tolerant cleanup.

ASTERISK-25323

Change-Id: Ic2d55c2c3750d5616e2a05ea92a19c717507ff56
---
M main/message.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/44/2344/1

diff --git a/main/message.c b/main/message.c
index 01a1c9b..c15975b 100644
--- a/main/message.c
+++ b/main/message.c
@@ -398,7 +398,7 @@
 	struct ast_msg *msg = obj;
 
 	ast_string_field_free_memory(msg);
-	ao2_ref(msg->vars, -1);
+	ao2_cleanup(msg->vars);
 }
 
 struct ast_msg *ast_msg_alloc(void)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2d55c2c3750d5616e2a05ea92a19c717507ff56
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-code-review mailing list