public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/dtc: Fix a resource leak
@ 2010-07-02 11:52 Michal Marek
  2010-07-03  1:56 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Marek @ 2010-07-02 11:52 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, Martin Ettl, David Gibson

From: Martin Ettl <ettl.martin@gmx.de>

during a check of the current git head of the linux kernel with the
static code analysis tool cppcheck
(http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page)
the tool discovered a resource leak in linux-2.6/scripts/dtc/fstree.c.

Please refer the attached patch, that fixes the issue.

Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15363
Signed-off-by: Martin Ettl <ettl.martin@gmx.de>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/dtc/fstree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scripts/dtc/fstree.c b/scripts/dtc/fstree.c
index 766b269..8fe1bdf 100644
--- a/scripts/dtc/fstree.c
+++ b/scripts/dtc/fstree.c
@@ -77,6 +77,7 @@ static struct node *read_fstree(const char *dirname)
 		free(tmpnam);
 	}
 
+	closedir(d);
 	return tree;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/dtc: Fix a resource leak
  2010-07-02 11:52 [PATCH] scripts/dtc: Fix a resource leak Michal Marek
@ 2010-07-03  1:56 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2010-07-03  1:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel, Martin Ettl

On Fri, Jul 02, 2010 at 01:52:14PM +0200, Michal Marek wrote:
> From: Martin Ettl <ettl.martin@gmx.de>
> 
> during a check of the current git head of the linux kernel with the
> static code analysis tool cppcheck
> (http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page)
> the tool discovered a resource leak in linux-2.6/scripts/dtc/fstree.c.
> 
> Please refer the attached patch, that fixes the issue.

I'll submit a patch for this to upstream dtc.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-03  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-02 11:52 [PATCH] scripts/dtc: Fix a resource leak Michal Marek
2010-07-03  1:56 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox