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

Scott Griepentrog asteriskteam at digium.com
Wed Mar 2 11:20:22 CST 2016


Scott Griepentrog has uploaded a new change for review.

  https://gerrit.asterisk.org/2343

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/43/2343/1

diff --git a/main/message.c b/main/message.c
index 7098f69..54c604c 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/2343
To unsubscribe, visit https://gerrit.asterisk.org/settings

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



More information about the asterisk-code-review mailing list