summaryrefslogtreecommitdiff
path: root/src/http_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http_auth.c')
-rw-r--r--src/http_auth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/http_auth.c b/src/http_auth.c
index 2d6180e2..357f4a1b 100644
--- a/src/http_auth.c
+++ b/src/http_auth.c
@@ -894,7 +894,6 @@ int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p,
realm = (data_string *)array_get_element(req, CONST_STR_LEN("realm"));
username = buffer_init();
- password = buffer_init();
if (!base64_decode(username, realm_str)) {
log_error_write(srv, __FILE__, __LINE__, "sb", "decodeing base64-string failed", username);
@@ -915,6 +914,8 @@ int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p,
username->used = pw - username->ptr;
+ password = buffer_init();
+
/* copy password to r1 */
if (http_auth_get_password(srv, p, username, realm->value, password)) {
buffer_free(username);