mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 03:18:30 +00:00
Merge "res_sorcery_astdb: Fix creation of retrieved objects." into 13.9
This commit is contained in:
@@ -97,7 +97,6 @@ static void *sorcery_astdb_retrieve_fields_common(const struct ast_sorcery *sorc
|
|||||||
const char *key = entry->key + strlen(family) + 2;
|
const char *key = entry->key + strlen(family) + 2;
|
||||||
RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
|
RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
|
||||||
struct ast_json_error error;
|
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);
|
RAII_VAR(struct ast_variable *, existing, NULL, ast_variables_destroy);
|
||||||
void *object = NULL;
|
void *object = NULL;
|
||||||
|
|
||||||
@@ -113,7 +112,7 @@ static void *sorcery_astdb_retrieve_fields_common(const struct ast_sorcery *sorc
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(object = ast_sorcery_alloc(sorcery, type, key)) ||
|
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);
|
ao2_cleanup(object);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user