From d277f3ec3ee7a7a38971f5da56bd79347ac6bf9a Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 21 Feb 2014 18:04:54 +0000 Subject: 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 --- apps/app_meetme.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'apps/app_meetme.c') 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; } } -- cgit v1.2.3