[apr] scan-build: Fix dereference of a null pointer and unused variable in network_io/unix

This commit is contained in:
Andrey Volk committed 2020-02-15 03:49:05 +04:00
1 parent fb9f7aa170
commit df52479eb4
2 files changed
+8 -1

No files matched your search

+5 -1
View File
@@ -32,7 +32,11 @@ static apr_status_t socket_cleanup(void *sock)
{
apr_socket_t *thesocket = sock;
if (thesocket && thesocket->socketdes == -1) {
if (!thesocket) {
return APR_ENOTSOCK;
}
if (thesocket->socketdes == -1) {
return APR_SUCCESS;
}