Fix a few trivial mem leaks when returning from scan_tree/scan_rom.

Signed-off-by: Jesper Juhl <j...@chaosbits.net>
---
 Documentation/ia64/aliasing-test.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Documentation/ia64/aliasing-test.c 
b/Documentation/ia64/aliasing-test.c
index 62a190d..33ed7a7 100644
--- a/Documentation/ia64/aliasing-test.c
+++ b/Documentation/ia64/aliasing-test.c
@@ -96,6 +96,7 @@ static int scan_tree(char *path, char *file, off_t offset, 
size_t length, int to
                                fprintf(stderr, "PASS: %s 0x%lx-0x%lx not 
mappable\n", path2, offset, offset + length);
                        else {
                                fprintf(stderr, "FAIL: %s 0x%lx-0x%lx not 
accessible\n", path2, offset, offset + length);
+                               free(path2);
                                return rc;
                        }
                } else {
@@ -185,6 +186,7 @@ static int scan_rom(char *path, char *file)
                                fprintf(stderr, "PASS: %s read %d bytes\n", 
path2, rc);
                        else {
                                fprintf(stderr, "PASS: %s not readable\n", 
path2);
+                               free(path2);
                                return rc;
                        }
                } else {
-- 
1.7.1

-- 
Jesper Juhl <j...@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to