callcgi: Fixed possible deadlock problem on aborted requests.
authorFredrik Tolf <fredrik@dolda2000.com>
Tue, 7 Mar 2017 02:24:17 +0000 (03:24 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Tue, 7 Mar 2017 02:24:17 +0000 (03:24 +0100)
src/callcgi.c

index 67a6d14..2b1c9e6 100644 (file)
@@ -436,6 +436,7 @@ int main(int argc, char **argv, char **envp)
     printf("\n");
     if(passdata(out, stdout))
        kill(child, SIGINT);
+    fclose(out);
     if(waitpid(child, &estat, 0) == child) {
        if(WCOREDUMP(estat))
            flog(LOG_WARNING, "CGI handler `%s' dumped core", prog.b[0]);