Commit 92824a94 authored by Ian Craggs's avatar Ian Craggs

Fix some static analysis "problems"

Bug:375532
parent 0206989e
...@@ -662,7 +662,8 @@ int keysUnix(char *dirname, char ***keys, int *nkeys) ...@@ -662,7 +662,8 @@ int keysUnix(char *dirname, char ***keys, int *nkeys)
goto exit; goto exit;
} }
if (nfkeys != 0 ) if (nfkeys != 0)
{
fkeys = (char **)malloc(nfkeys * sizeof(char *)); fkeys = (char **)malloc(nfkeys * sizeof(char *));
/* copy the keys */ /* copy the keys */
...@@ -691,6 +692,7 @@ int keysUnix(char *dirname, char ***keys, int *nkeys) ...@@ -691,6 +692,7 @@ int keysUnix(char *dirname, char ***keys, int *nkeys)
rc = MQTTCLIENT_PERSISTENCE_ERROR; rc = MQTTCLIENT_PERSISTENCE_ERROR;
goto exit; goto exit;
} }
}
*nkeys = nfkeys; *nkeys = nfkeys;
*keys = fkeys; *keys = fkeys;
......
...@@ -616,6 +616,9 @@ int Socket_new(char* addr, int port, int* sock) ...@@ -616,6 +616,9 @@ int Socket_new(char* addr, int port, int* sock)
res = res->ai_next; res = res->ai_next;
} }
if (result == NULL)
rc = -1;
else
#if defined(AF_INET6) #if defined(AF_INET6)
if (result->ai_family == AF_INET6) if (result->ai_family == AF_INET6)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment