aboutsummaryrefslogtreecommitdiff
path: root/src/examples/digest_auth_example.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-10-09 22:41:11 +0200
committerChristian Grothoff <christian@grothoff.org>2017-10-09 22:41:11 +0200
commit330a40552cbd26ebcdf25bf209e12697ac330737 (patch)
tree7db9138ce0dfb398aae4aa560ea43cbe3baeedd6 /src/examples/digest_auth_example.c
parent181ac3c59fffd599cd6b351940bffd5c6c930fd7 (diff)
downloadlibmicrohttpd-330a40552cbd26ebcdf25bf209e12697ac330737.tar.gz
libmicrohttpd-330a40552cbd26ebcdf25bf209e12697ac330737.zip
add MHD_free(), as suggested by Tim on the mailinglist
Diffstat (limited to 'src/examples/digest_auth_example.c')
-rw-r--r--src/examples/digest_auth_example.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c
index 4b00669f..889967fb 100644
--- a/src/examples/digest_auth_example.c
+++ b/src/examples/digest_auth_example.c
@@ -54,7 +54,7 @@ ahc_echo (void *cls,
54 (void)ptr; /* Unused. Silent compiler warning. */ 54 (void)ptr; /* Unused. Silent compiler warning. */
55 55
56 username = MHD_digest_auth_get_username(connection); 56 username = MHD_digest_auth_get_username(connection);
57 if (username == NULL) 57 if (NULL == username)
58 { 58 {
59 response = MHD_create_response_from_buffer(strlen (DENIED), 59 response = MHD_create_response_from_buffer(strlen (DENIED),
60 DENIED, 60 DENIED,
@@ -70,7 +70,7 @@ ahc_echo (void *cls,
70 username, 70 username,
71 password, 71 password,
72 300); 72 300);
73 free(username); 73 MHD_free (username);
74 if ( (ret == MHD_INVALID_NONCE) || 74 if ( (ret == MHD_INVALID_NONCE) ||
75 (ret == MHD_NO) ) 75 (ret == MHD_NO) )
76 { 76 {
@@ -93,6 +93,7 @@ ahc_echo (void *cls,
93 return ret; 93 return ret;
94} 94}
95 95
96
96int 97int
97main (int argc, char *const *argv) 98main (int argc, char *const *argv)
98{ 99{