diff --git a/sources/auth_query.c b/sources/auth_query.c index 12c2fb0fb..30d942690 100644 --- a/sources/auth_query.c +++ b/sources/auth_query.c @@ -142,6 +142,9 @@ int od_auth_query(od_client_t *client, char *peer) user->value_len, user->value); /* unlock hashmap entry */ password->password_len = cache_value->passwd_len; + if (password->password == NULL) { + goto error; + } if (cache_value->passwd_len > 0) { /* */ password->password = malloc(password->password_len + 1); @@ -259,6 +262,9 @@ int od_auth_query(od_client_t *client, char *peer) } cache_value->passwd_len = password->password_len; cache_value->passwd = malloc(password->password_len); + if (cache_value->passwd == NULL) { + goto error; + } strncpy(cache_value->passwd, password->password, cache_value->passwd_len);