Browse Source

apply memory leak fix for create_and_bind to create_server_socket

pull/2842/head
Gilles Depeyrot 3 years ago
committed by Max Lv
parent
commit
49ead5e570
1 changed files with 5 additions and 3 deletions
  1. 8
      src/manager.c

8
src/manager.c

@ -442,7 +442,7 @@ create_and_bind(const char *host, const char *port, int protocol)
}
}
if (!result) {
if (result != NULL) {
freeaddrinfo(result);
}
@ -837,13 +837,15 @@ create_server_socket(const char *host, const char *port)
close(server_sock);
}
if (result != NULL) {
freeaddrinfo(result);
}
if (rp == NULL) {
LOGE("cannot bind");
return -1;
}
freeaddrinfo(result);
return server_sock;
}

Loading…
Cancel
Save