mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
cgi: Fix the possible memleak and close pipes in case of error.
This commit is contained in:
parent
9179c8d3f6
commit
035ce283c7
@ -373,12 +373,14 @@ execute_cgi(struct connection *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else { /* ELinks */
|
} else { /* ELinks */
|
||||||
|
|
||||||
if (!init_http_connection_info(conn, 1, 0, 1))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
mem_free(script);
|
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]);
|
close(pipe_read[1]); close(pipe_write[0]);
|
||||||
conn->socket->fd = pipe_read[0];
|
conn->socket->fd = pipe_read[0];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user