summaryrefslogtreecommitdiff
path: root/res/res_sorcery_astdb.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-08-02 14:27:35 +0000
committerDavid M. Lee <dlee@digium.com>2013-08-02 14:27:35 +0000
commit10c91bc96eafbf5f897869ede83127c9c267981c (patch)
treec9aaaf3cc4c9794057e258166854d5f88a6a0c18 /res/res_sorcery_astdb.c
parent328e99f41d48d8f15832bf4f6c97beb0ef71fc0c (diff)
Address JSON thread safety issues.
In tracking down some unit tests failures, I ended up reading the fine print[1] regarding Jansson's thread safety. In short: 1. Ref-counting is non-atomic. 2. json_dumps() and friends are not thread safe. This patch adds locking where necessary to our ast_json_* wrapper API, with documentation in json.h describing the thread safety limitations of the API. [1]: http://www.digip.org/jansson/doc/2.4/portability.html#thread-safety Review: https://reviewboard.asterisk.org/r/2716/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_sorcery_astdb.c')
-rw-r--r--res/res_sorcery_astdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_sorcery_astdb.c b/res/res_sorcery_astdb.c
index 65a6a504e..ecea885d0 100644
--- a/res/res_sorcery_astdb.c
+++ b/res/res_sorcery_astdb.c
@@ -126,7 +126,7 @@ static int sorcery_json_equal(struct ast_json *object, struct ast_json *criteria
static int sorcery_astdb_create(const struct ast_sorcery *sorcery, void *data, void *object)
{
RAII_VAR(struct ast_json *, objset, ast_sorcery_objectset_json_create(sorcery, object), ast_json_unref);
- RAII_VAR(char *, value, NULL, ast_free_ptr);
+ RAII_VAR(char *, value, NULL, ast_json_free);
const char *prefix = data;
char family[strlen(prefix) + strlen(ast_sorcery_object_get_type(object)) + 2];