[asterisk-commits] kmoore: branch kmoore/stasis-channel_events r384160 - /team/kmoore/stasis-cha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 27 14:32:20 CDT 2013


Author: kmoore
Date: Wed Mar 27 14:32:17 2013
New Revision: 384160

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384160
Log:
Remove early ast_json_deref

ast_json_object_set steals the reference, so there is no need to unref the new string.

Modified:
    team/kmoore/stasis-channel_events/apps/app_userevent.c

Modified: team/kmoore/stasis-channel_events/apps/app_userevent.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-channel_events/apps/app_userevent.c?view=diff&rev=384160&r1=384159&r2=384160
==============================================================================
--- team/kmoore/stasis-channel_events/apps/app_userevent.c (original)
+++ team/kmoore/stasis-channel_events/apps/app_userevent.c Wed Mar 27 14:32:17 2013
@@ -91,7 +91,7 @@
 
 	for (x = 0; x < args.argc - 1; x++) {
 		char *key, *value = args.extra[x];
-		RAII_VAR(struct ast_json *, json_value, NULL, ast_json_unref);
+		struct ast_json *json_value;
 
 		key = strsep(&value, ":");
 		if (!value) {
@@ -105,6 +105,7 @@
 			return -1;
 		}
 
+		/* ref stolen by ast_json_object_set */
 		if (ast_json_object_set(blob, key, json_value)) {
 			return -1;
 		}




More information about the asterisk-commits mailing list