Commit 7a7c2afa authored by Robert Schmidt's avatar Robert Schmidt

Handle cppcheck errors in ASYNC_IF

parent 66d4c4e9
......@@ -222,7 +222,7 @@ socket_link_t *new_link_udp_client(const char *server, int port){
ret = calloc(1, sizeof(socket_link_t));
if (ret == NULL) {
LOG_E(MAC, "%s:%d: out of memory\n", __FILE__, __LINE__);
//goto error;
goto error;
}
ret->socket_fd = -1;
......@@ -253,8 +253,10 @@ socket_link_t *new_link_udp_client(const char *server, int port){
return ret;
error:
if (ret != NULL) close(ret->socket_fd);
if (ret != NULL) {
close(ret->socket_fd);
free(ret);
}
LOG_E(MAC, "ERROR in new_link_udp_client (see above), returning NULL\n");
return NULL;
}
......
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