[asterisk-commits] res/ari/config.c: Fix conf alloc() object init. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 29 13:25:56 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: res/ari/config.c: Fix conf_alloc() object init.
......................................................................


res/ari/config.c: Fix conf_alloc() object init.

Need to finish initializing the string fields in the ao2 object before
putting any default strings into them.

ASTERISK-25383 #close
Reported by:  yaron nahum

Change-Id: I9f7f3a03f0c4991a01593abf8697b9a587c0ea84
---
M res/ari/config.c
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/res/ari/config.c b/res/ari/config.c
index 667d91a..cc544c0 100644
--- a/res/ari/config.c
+++ b/res/ari/config.c
@@ -182,11 +182,10 @@
 	if (!cfg->general) {
 		return NULL;
 	}
-	aco_set_defaults(&general_option, "general", cfg->general);
-
 	if (ast_string_field_init(cfg->general, 64)) {
 		return NULL;
 	}
+	aco_set_defaults(&general_option, "general", cfg->general);
 
 	cfg->users = ao2_container_alloc_rbtree(AO2_ALLOC_OPT_LOCK_NOLOCK,
 		AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, user_sort_cmp, NULL);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9f7f3a03f0c4991a01593abf8697b9a587c0ea84
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list