CID:1301050 fix possible NULL

This commit is contained in:
Seven Du 2015-05-29 12:12:07 +08:00
parent 55462887e8
commit 81ad7562a3
1 changed files with 7 additions and 5 deletions

View 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) {