diff options
author | Richard Quirk <richard@quirk.es> | 2015-07-25 13:03:02 +0000 |
---|---|---|
committer | Richard Quirk <richard@quirk.es> | 2015-07-25 13:03:02 +0000 |
commit | 913628e0d68564ab0f3f1e1e51902af93454effc (patch) | |
tree | 9bbd5d0e68270c7e6eef673423fe871dc88f28f4 | |
parent | Avoid passing null to strlen (diff) | |
download | w3m-913628e0d68564ab0f3f1e1e51902af93454effc.tar.gz w3m-913628e0d68564ab0f3f1e1e51902af93454effc.zip |
Close temp file if pipe open fails
Diffstat (limited to '')
-rw-r--r-- | local.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -386,9 +386,11 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer) cgi_basename = mybasename(file); pid = open_pipe_rw(&fr, NULL); /* 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; - else if (pid) { + } else if (pid) { if (fw) fclose(fw); return fr; |