mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
cgi: Fix the possible memleak and close pipes in case of error.
This commit is contained in:
parent
38f85be76a
commit
322b003e22
@ -373,12 +373,14 @@ execute_cgi(struct connection *conn)
|
||||
}
|
||||
|
||||
} else { /* ELinks */
|
||||
|
||||
if (!init_http_connection_info(conn, 1, 0, 1))
|
||||
return 0;
|
||||
|
||||
mem_free(script);
|
||||
|
||||
if (!init_http_connection_info(conn, 1, 0, 1)) {
|
||||
close(pipe_read[0]); close(pipe_read[1]);
|
||||
close(pipe_write[0]); close(pipe_write[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
close(pipe_read[1]); close(pipe_write[0]);
|
||||
conn->socket->fd = pipe_read[0];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user