pgpool2.git / summary / log / commit / refs
commit b7209285a8d98f012d845fd914171ef8fbb27cf7
Author: Muhammad Usama <m.usama@gmail.com>
Date: Fri Jul 11 11:03:12 2014 +0000
Fix coverity issue:1222999 Resource leak.
Fix coverity issue:1222998 Resource leak.
src/auth/pool_hba.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/auth/pool_hba.c b/src/auth/pool_hba.c
index 568dc8e81..323fffea0 100644
--- a/src/auth/pool_hba.c
+++ b/src/auth/pool_hba.c
@@ -709,12 +709,19 @@ static void parse_hba(List *line, int line_num, POOL_CONNECTION *frontend,
* will override '\001' with '\0'.
*/
db_tmp = pstrdup(db);
- user_tmp = pstrdup(user);
if (!check_db(frontend->database, frontend->username, db_tmp))
+ {
+ pfree(db_tmp);
return;
+ }
+ pfree(db_tmp);
+
+ user_tmp = pstrdup(user);
if (!check_user(frontend->username, user_tmp))
+ {
+ pfree(user_tmp);
return;
- pfree(db_tmp);
+ }
pfree(user_tmp);
/* Success */
[parent: e18732934058]