Skip to content

Commit 111212b

Browse files
maks-mishinbmah888
authored andcommitted
Fix memory leak with addrinfo
1 parent e06177c commit 111212b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/net.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ create_socket(int domain, int proto, const char *local, const char *bind_dev, in
145145
if ((gerror = getaddrinfo(server, portstr, &hints, &server_res)) != 0) {
146146
if (local)
147147
freeaddrinfo(local_res);
148+
freeaddrinfo(server_res);
148149
return -1;
149150
}
150151

0 commit comments

Comments
 (0)