commit 22e9f3c1dc58f10c005a71adb9e66d5700dc15d4
parent a1ad4d85055e4b3cea1f135c353f40fc66e809fc
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 4 Sep 2016 16:38:06 +0000
-check for NULL first
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -3170,7 +3170,7 @@ MHD_queue_response (struct MHD_Connection *connection,
unsigned int status_code,
struct MHD_Response *response)
{
- struct MHD_Daemon *daemon = connection->daemon;
+ struct MHD_Daemon *daemon;
if ( (NULL == connection) ||
(NULL == response) ||
@@ -3187,6 +3187,7 @@ MHD_queue_response (struct MHD_Connection *connection,
#endif
return MHD_NO;
}
+ daemon = connection->daemon;
if ( (NULL != response->upgrade_handler) &&
(0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
(0 == (daemon->options & MHD_USE_SUSPEND_RESUME)) )