From a760f7e3200ac3ac44240ec5783c97c530f3676e Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 4 May 2011 22:34:12 +0200 Subject: [PATCH] Fix minor memory leak in get_cwd() Found and suggested by Bo Rydberg. --- util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index e53467148..d68d8c558 100644 --- a/util.c +++ b/util.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2002 Andrew Tridgell - * Copyright (C) 2009-2010 Joel Rosdahl + * Copyright (C) 2009-2011 Joel Rosdahl * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -932,6 +932,7 @@ get_cwd(void) return cwd; } if (st_pwd.st_dev == st_cwd.st_dev && st_pwd.st_ino == st_cwd.st_ino) { + free(cwd); return x_strdup(pwd); } else { return cwd; -- 2.47.2