Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fb-martin committed Sep 12, 2020
1 parent c6641d0 commit 37c582d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions echttp_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,16 @@ int echttp_raw_connect (const char *host, const char *service) {
if (echttp_raw_debug)
printf ("connection failed: %s\n", strerror(errno));
close(s);
freeaddrinfo(resolved);
return -1;
}
}
echttp_raw_client[i].socket = s;
echttp_raw_client[i].peer = (struct sockaddr_in){0};
freeaddrinfo(resolved);
return i;
}
freeaddrinfo(resolved);
return -1;
}

Expand Down

0 comments on commit 37c582d

Please sign in to comment.