[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch for memory leak
From: |
supriya kannery |
Subject: |
Patch for memory leak |
Date: |
Fri, 09 Feb 2007 16:15:38 +0530 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050523 |
Hello James,
While analysing find utility using valgrind the following memory
leak was detected.
==9767== LEAK SUMMARY:
==9767== definitely lost: 120 bytes in 10 blocks.
On further analysis, found that the dirinfo structure is not getting cleaned up
after use
and resulting in memory leak. Cleaning up of dirinfo pointer resolves this.
Please find
the patch for this attached. This diff is prepared over the current release of
findutils,
findutils-4.2.29.
Thanks & Rgds, Supriya
--- lib/savedirinfo.c 2005-07-02 15:24:34.000000000 +0530
+++ lib/savedirinfo.c.mod 2007-02-09 15:48:07.000000000 +0530
@@ -253,6 +253,8 @@ void free_dirinfo(struct savedir_dirinfo
p->entries = NULL;
free(p->buffer);
p->buffer = NULL;
+ free(p);
+ p = NULL;
}
- Patch for memory leak,
supriya kannery <=