]> Git Repo - linux.git/commitdiff
scripts/dtc: Fix a resource leak
authorMartin Ettl <[email protected]>
Sun, 21 Feb 2010 08:31:44 +0000 (09:31 +0100)
committerMichal Marek <[email protected]>
Fri, 2 Jul 2010 11:51:11 +0000 (13:51 +0200)
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 <[email protected]>
Cc: David Gibson <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
scripts/dtc/fstree.c

index 766b2694d93589fe39ea6313dbae7b1ce5a21daa..8fe1bdf239f0f7a4d1e40baadf9cd8430c5176aa 100644 (file)
@@ -77,6 +77,7 @@ static struct node *read_fstree(const char *dirname)
                free(tmpnam);
        }
 
+       closedir(d);
        return tree;
 }
 
This page took 0.052766 seconds and 4 git commands to generate.