Close temp file if pipe open fails
This commit is contained in:
6
local.c
6
local.c
@@ -386,9 +386,11 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
|
|||||||
cgi_basename = mybasename(file);
|
cgi_basename = mybasename(file);
|
||||||
pid = open_pipe_rw(&fr, NULL);
|
pid = open_pipe_rw(&fr, NULL);
|
||||||
/* Don't invoke gc after here, or the program might crash in some platforms */
|
/* Don't invoke gc after here, or the program might crash in some platforms */
|
||||||
if (pid < 0)
|
if (pid < 0) {
|
||||||
|
if (fw)
|
||||||
|
fclose(fw);
|
||||||
return NULL;
|
return NULL;
|
||||||
else if (pid) {
|
} else if (pid) {
|
||||||
if (fw)
|
if (fw)
|
||||||
fclose(fw);
|
fclose(fw);
|
||||||
return fr;
|
return fr;
|
||||||
|
Reference in New Issue
Block a user