]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1301050 fix possible NULL
authorSeven Du <dujinfang@gmail.com>
Fri, 29 May 2015 04:12:07 +0000 (12:12 +0800)
committerSeven Du <dujinfang@gmail.com>
Fri, 29 May 2015 04:12:07 +0000 (12:12 +0800)
src/mod/endpoints/mod_rtmp/mod_rtmp.c

index 76360e5641c0c50714d53bdc2ad2e422dbf5334a..b67f326b8275ef32b026351f3434c3f670ade746 100644 (file)
@@ -1713,12 +1713,14 @@ SWITCH_STANDARD_API(rtmp_function)
                        }
                } else if (!strcmp(argv[2], "rescan")) {
                        rtmp_profile_t *profile = rtmp_profile_locate(argv[1]);
-                       if (config_profile(profile, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
-                               stream->write_function(stream, "+OK\n");
-                       } else {
-                               stream->write_function(stream, "-ERR Config error\n");
+                       if (profile) {
+                               if (config_profile(profile, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
+                                       stream->write_function(stream, "+OK\n");
+                               } else {
+                                       stream->write_function(stream, "-ERR Config error\n");
+                               }
+                               rtmp_profile_release(profile);
                        }
-                       rtmp_profile_release(profile);
                } else if (!strcmp(argv[2], "restart")) {
                        rtmp_profile_t *profile = rtmp_profile_locate(argv[1]);
                        if (profile) {