aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/basicauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/basicauth.c')
-rw-r--r--src/microhttpd/basicauth.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/microhttpd/basicauth.c b/src/microhttpd/basicauth.c
index d39019f5..a20a43d3 100644
--- a/src/microhttpd/basicauth.c
+++ b/src/microhttpd/basicauth.c
@@ -109,14 +109,14 @@ MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
109 109
110 110
111/** 111/**
112 * Queues a response to request basic authentication from the client. 112 * Queues a response to request basic authentication from the client
113 * The given response object is expected to include the payload for 113 * The given response object is expected to include the payload for
114 * the response; the "WWW-Authenticate" header will be added and the 114 * the response; the "WWW-Authenticate" header will be added and the
115 * response queued with the 'UNAUTHORIZED' status code. 115 * response queued with the 'UNAUTHORIZED' status code.
116 * 116 *
117 * @param connection The MHD connection structure 117 * @param connection The MHD connection structure
118 * @param realm the realm presented to the client 118 * @param realm the realm presented to the client
119 * @param response response object to modify and queue 119 * @param response response object to modify and queue; the NULL is tolerated
120 * @return #MHD_YES on success, #MHD_NO otherwise 120 * @return #MHD_YES on success, #MHD_NO otherwise
121 * @ingroup authentication 121 * @ingroup authentication
122 */ 122 */
@@ -130,6 +130,9 @@ MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection,
130 size_t hlen = strlen (realm) + strlen ("Basic realm=\"\"") + 1; 130 size_t hlen = strlen (realm) + strlen ("Basic realm=\"\"") + 1;
131 char *header; 131 char *header;
132 132
133 if (NULL == response)
134 return MHD_NO;
135
133 header = (char *) malloc (hlen); 136 header = (char *) malloc (hlen);
134 if (NULL == header) 137 if (NULL == header)
135 { 138 {