From 8e391f29a12f7d5fc551ff80d1a7d12a0fac780f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 29 Oct 2011 15:14:39 +0200 Subject: [PATCH] Plug memory leak in set_paths() error path Leak appeared in commit 91eefc3f, v4.3.12. Harmless in practice, since the error is ultimately fatal. --- src/lib/common/emp_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/common/emp_config.c b/src/lib/common/emp_config.c index 11ffb62d9..89cead07c 100644 --- a/src/lib/common/emp_config.c +++ b/src/lib/common/emp_config.c @@ -29,7 +29,7 @@ * Known contributors to this file: * Julian Onions, 1995 * Steve McClure, 1998-2000 - * Markus Armbruster, 2004-2009 + * Markus Armbruster, 2004-2011 */ /* @@ -178,6 +178,8 @@ set_paths(char *econfig) if (p[0] != '/') { fprintf(stderr, "Can't get current working directory (%s)\n", strerror(errno)); + if (p != econfig) + free(p); return -1; } if (p == econfig) -- 2.43.0