Merge pull request #476 from dragos-oancea/mod_unimrcp-nullptr

[mod_unimrcp] scan-build: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'mod_profile')
This commit is contained in:
Andrey Volk 2020-03-12 20:21:20 +04:00 committed by GitHub
commit 396d07c1a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -4232,7 +4232,12 @@ static mrcp_client_t *mod_unimrcp_client_create(switch_memory_pool_t *mod_pool)
/* prepare mod_unimrcp's profile for configuration */
profile_create(&mod_profile, name, mod_pool);
switch_core_hash_insert(globals.profiles, mod_profile->name, mod_profile);
if (mod_profile) {
switch_core_hash_insert(globals.profiles, mod_profile->name, mod_profile);
} else {
client = NULL;
goto done;
}
/* pull in any default SPEAK params */
default_params = switch_xml_child(profile, "synthparams");