diff --git a/doc/examples/basicauthentication.c b/doc/examples/basicauthentication.c index 389d8bb7..c96a8da9 100644 --- a/doc/examples/basicauthentication.c +++ b/doc/examples/basicauthentication.c @@ -72,15 +72,14 @@ is_authenticated (struct MHD_Connection *connection, strcat (expected, password); expected_b64 = string_to_base64 (expected); + free (expected); if (NULL == expected_b64) - return 0; + return 0; - strcpy (expected, strbase); authenticated = (strcmp (headervalue + strlen (strbase), expected_b64) == 0); free (expected_b64); - return authenticated; }