pgpool2.git / summary / log / commit / refs
commit c13231cd2a083eff07912dbe2bb4fedf5a24dd31
Author: Masaya Kawamoto <kawamoto@sraoss.co.jp>
Date: Mon Apr 11 07:20:58 2022 +0000
Fix memory leak pointed out by Coverity.
src/auth/pool_passwd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/auth/pool_passwd.c b/src/auth/pool_passwd.c
index fb4ee3528..5d93e54b6 100644
--- a/src/auth/pool_passwd.c
+++ b/src/auth/pool_passwd.c
@@ -705,7 +705,6 @@ int
chceck_password_type_is_not_md5(char *username, char *password_in_config)
{
PasswordType passwordType = PASSWORD_TYPE_UNKNOWN;
- PasswordMapping *password_mapping = NULL;
/*
* if the password specified in config is empty string or NULL look for the
@@ -713,12 +712,14 @@ chceck_password_type_is_not_md5(char *username, char *password_in_config)
*/
if (password_in_config == NULL || strlen(password_in_config) == 0)
{
+ PasswordMapping *password_mapping = NULL;
password_mapping = pool_get_user_credentials(username);
if (password_mapping == NULL)
{
return -2;
}
passwordType = password_mapping->pgpoolUser.passwordType;
+ delete_passwordMapping(password_mapping);
}
else
{
[parent: 1c7603bf1979]