Skip to content

Commit

Permalink
internal_parse_url: fix memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
  • Loading branch information
nmav committed Nov 17, 2020
1 parent 4061451 commit f9349c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion http.c
Expand Up @@ -763,8 +763,10 @@ int internal_parse_url(const char *url, char **res_proto, char **res_host,
if (!*end) {
*port_str = 0;
port = new_port;
if (port <= 0 || port > 0xffff)
if (port <= 0 || port > 0xffff) {
free(host);
return -EINVAL;
}
}
}

Expand Down

0 comments on commit f9349c9

Please sign in to comment.