From d5a3825aca4520ed71d44c5d652f994960d42686 Mon Sep 17 00:00:00 2001 From: Dotan Barak Date: Tue, 16 Jan 2007 12:26:39 -0800 Subject: [PATCH] Fix some memory leaks in read_config() error path Don't leak path if stat() fails or file isn't a regular file. Signed-off-by: Dotan Barak Signed-off-by: Roland Dreier --- src/init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/init.c b/src/init.c index 3b5fc89..664c584 100644 --- a/src/init.c +++ b/src/init.c @@ -312,13 +312,14 @@ static void read_config(void) if (stat(path, &buf)) { fprintf(stderr, PFX "Warning: couldn't stat config file '%s'.\n", path); - continue; + goto next; } if (!S_ISREG(buf.st_mode)) - continue; + goto next; read_config_file(path); + next: free(path); } -- 2.46.0