diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-02-21 18:04:54 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-02-21 18:04:54 +0000 |
commit | d277f3ec3ee7a7a38971f5da56bd79347ac6bf9a (patch) | |
tree | 500ce6ebba19b01725cdcda97108cdbb8b5fb557 /apps/app_meetme.c | |
parent | eec8ccc10b9c88e0afb4504ed9a6074da06caaa9 (diff) |
json: Fix off-nominal json ref counting issues.
* Fixed off-nominal json ref counting issue with using the following API
calls: ast_json_object_set() and ast_json_array_append().
* Fixed off-nominal error reporting in ast_ari_endpoints_list().
* Fixed some miscellaneous off-nominal json ref counting issues in
report_receive_fax_status() and dial_to_json().
........
Merged revisions 408713 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r-- | apps/app_meetme.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 4651bf0eb..37053b3e6 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -1362,25 +1362,20 @@ static void meetme_stasis_generate_msg(struct ast_conference *meetme_conference, if (user) { struct timeval now = ast_tvnow(); long duration = (long)(now.tv_sec - user->jointime); - RAII_VAR(struct ast_json *, json_user, ast_json_integer_create(user->user_no), ast_json_unref); - RAII_VAR(struct ast_json *, json_user_duration, NULL, ast_json_unref); + struct ast_json *json_user; + struct ast_json *json_user_duration; - if (ast_json_object_set(json_object, "user", json_user)) { + json_user = ast_json_integer_create(user->user_no); + if (!json_user || ast_json_object_set(json_object, "user", json_user)) { return; } - json_user = NULL; if (duration > 0) { json_user_duration = ast_json_integer_create(duration); - - if (!json_user_duration) { - return; - } - - if (ast_json_object_set(json_object, "duration", json_user_duration)) { + if (!json_user_duration + || ast_json_object_set(json_object, "duration", json_user_duration)) { return; } - json_user_duration = NULL; } } |