[Asterisk-code-review] res sorcery astdb: Fix creation of retrieved objects. (asterisk[13.9])

Joshua Colp asteriskteam at digium.com
Thu May 12 19:16:50 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: res_sorcery_astdb: Fix creation of retrieved objects.
......................................................................


res_sorcery_astdb: Fix creation of retrieved objects.

The contents of this commit come from a portion of commit
a01ce2b88912cd802bb045e40fe264906e55bc45 of the 13 branch.

The commit referenced above's main point was to introduce some
performance enhancements for realtime. However, mixed in with that was a
bug fix for sorcery's astdb backend. The astdb was using an empty
objectset to create an object.

This, combined with the floating point conversion bug, was what was
contributing to contacts being deleted early.

ASTERISK-26007 #close
Reported by Greg Siemon

Change-Id: I84594079356a6fb2d2f61d56bf644e5409925ee2
---
M res/res_sorcery_astdb.c
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/res_sorcery_astdb.c b/res/res_sorcery_astdb.c
index e5de9f7..c6b5a1b 100644
--- a/res/res_sorcery_astdb.c
+++ b/res/res_sorcery_astdb.c
@@ -97,7 +97,6 @@
 		const char *key = entry->key + strlen(family) + 2;
 		RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 		struct ast_json_error error;
-		RAII_VAR(struct ast_variable *, objset, NULL, ast_variables_destroy);
 		RAII_VAR(struct ast_variable *, existing, NULL, ast_variables_destroy);
 		void *object = NULL;
 
@@ -113,7 +112,7 @@
 		}
 
 		if (!(object = ast_sorcery_alloc(sorcery, type, key)) ||
-			ast_sorcery_objectset_apply(sorcery, object, objset)) {
+			ast_sorcery_objectset_apply(sorcery, object, existing)) {
 			ao2_cleanup(object);
 			return NULL;
 		}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I84594079356a6fb2d2f61d56bf644e5409925ee2
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13.9
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list