From: Daniel Gustafsson Date: Thu, 7 Jun 2018 20:59:53 +0000 (+0200) Subject: Avoid double-free in parse_filename X-Git-Tag: pgbouncer_1_9_0~32^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d07370ddd15384912337a14a38bf06f6e904553;p=pgbouncer Avoid double-free in parse_filename If the fopen() call fails parse_namefile() frees the filename buffer fn, and the caller does the same. Avoid freeing in parse_namefile() and leave the cleanup to the caller. --- diff --git a/src/hba.c b/src/hba.c index 5cc3d08..ca29ea3 100644 --- a/src/hba.c +++ b/src/hba.c @@ -359,7 +359,6 @@ static bool parse_namefile(struct HBAName *hname, const char *fn, bool is_db) f = fopen(fn, "r"); if (!f) { - free(fn); return false; } for (linenr = 1; ; linenr++) {