bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18145: memory leak in pwd


From: Bob Proulx
Subject: bug#18145: memory leak in pwd
Date: Fri, 1 Aug 2014 11:12:04 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]