GNU bug report logs - #18145
memory leak in pwd

Previous Next

Package: coreutils;

Reported by: srinivas devaki <mr.eightnoteight <at> gmail.com>

Date: Tue, 29 Jul 2014 11:09:03 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bob Proulx <bob <at> proulx.com>
To: srinivas devaki <mr.eightnoteight <at> gmail.com>, 18145 <at> debbugs.gnu.org
Subject: bug#18145: memory leak in pwd
Date: Fri, 1 Aug 2014 11:12:04 -0600
srinivas devaki wrote:
> i think there is a memory leak in pwd.c
> I’m extremely sorry if this is wrong. I’m sending the git diff.

> +          free (wd);
>            exit (EXIT_SUCCESS);

There is never a need to free memory before exiting from a program.
All work being done to free up the memory, coalesce memory blocks,
list memory blocks in a free list, and so forth is completely
unnecessary power that is wasted.  Think of the heat and battery life
wasted by doing this across zillions of devices.  Upon exit all
resources are freed as the program evaporates.

Bob




This bug report was last modified 10 years and 354 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.