From: Joel Rosdahl Date: Wed, 4 May 2011 20:34:12 +0000 (+0200) Subject: Fix minor memory leak in get_cwd() X-Git-Tag: v3.1.5~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a760f7e3200ac3ac44240ec5783c97c530f3676e;p=thirdparty%2Fccache.git Fix minor memory leak in get_cwd() Found and suggested by Bo Rydberg. --- 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;