forked from Telodendria/Telodendria
Fix segfault in fclose() on Linux.
This commit is contained in:
parent
5af229a86e
commit
6992f36c86
3 changed files with 15 additions and 15 deletions
|
@ -167,9 +167,7 @@ HttpServerContextFree(HttpServerContext * c)
|
|||
HashMapFree(c->requestParams);
|
||||
|
||||
Free(c->requestPath);
|
||||
#if 0
|
||||
fclose(c->stream);
|
||||
#endif
|
||||
|
||||
Free(c);
|
||||
}
|
||||
|
@ -596,6 +594,8 @@ HttpServerWorkerThread(void *args)
|
|||
server->requestHandler(context, server->handlerArgs);
|
||||
|
||||
HttpServerContextFree(context);
|
||||
fp = NULL; /* The above call will close this
|
||||
* FILE */
|
||||
goto finish;
|
||||
|
||||
internal_error:
|
||||
|
@ -610,8 +610,11 @@ bad_request:
|
|||
|
||||
finish:
|
||||
Free(line);
|
||||
if (fp)
|
||||
{
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -144,9 +144,6 @@ MatrixHttpHandler(HttpServerContext * context, void *argp)
|
|||
JsonFree(response);
|
||||
|
||||
finish:
|
||||
stream = HttpStream(context);
|
||||
fclose(stream);
|
||||
|
||||
LogConfigUnindent(lc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue