1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-16 15:04:37 -04:00

cgi: Fix the possible memleak and close pipes in case of error.

This commit is contained in:
Witold Filipczyk 2007-03-01 18:51:39 +01:00 committed by Witold Filipczyk
parent 38f85be76a
commit 322b003e22

View File

@ -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];