Merge pull request #429 from dragos-oancea/mod_erlang_event-nullptr-deref

[mod_erlang_event] scan-build: Access to field 'rwlock' results in a dereference of a null pointer (loaded from variable 'listener')
This commit is contained in:
Andrey Volk 2020-02-26 23:47:56 +04:00 committed by GitHub
commit 996daffb40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1376,7 +1376,9 @@ static listener_t *new_outbound_listener_locked(char *node)
listener->peer_nodename = switch_core_strdup(listener->pool, node);
}
switch_thread_rwlock_rdlock(listener->rwlock);
if (listener) {
switch_thread_rwlock_rdlock(listener->rwlock);
}
return listener;
}