[asterisk-commits] kmoore: branch kmoore/stasis-http_sounds r389732 - /team/kmoore/stasis-http_s...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 24 15:28:27 CDT 2013


Author: kmoore
Date: Fri May 24 15:28:23 2013
New Revision: 389732

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389732
Log:
Add null check

Modified:
    team/kmoore/stasis-http_sounds/main/file.c

Modified: team/kmoore/stasis-http_sounds/main/file.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-http_sounds/main/file.c?view=diff&rev=389732&r1=389731&r2=389732
==============================================================================
--- team/kmoore/stasis-http_sounds/main/file.c (original)
+++ team/kmoore/stasis-http_sounds/main/file.c Fri May 24 15:28:23 2013
@@ -77,6 +77,10 @@
 	RAII_VAR(char *, stringp, ast_strdup(list), ast_free);
 	char *ext;
 
+	if (!array || !stringp) {
+		return NULL;
+	}
+
 	while ((ext = strsep(&stringp, sep))) {
 		struct ast_json *ext_str = ast_json_string_create(ext);
 		if (!ext_str) {
@@ -104,7 +108,8 @@
 		return -1;
 	}
 
-	if (!(json_payload = ast_json_payload_create(json_object))) {
+	json_payload = ast_json_payload_create(json_object);
+	if (!json_payload) {
 		return -1;
 	}
 




More information about the asterisk-commits mailing list