Blame SOURCES/0144-filearch-Fix-memory-leak.patch

ffd6ed
From 99184a4b5e5ca7cabf10b410cfb5e1604a4e8cd3 Mon Sep 17 00:00:00 2001
ffd6ed
From: "Richard W.M. Jones" <rjones@redhat.com>
ffd6ed
Date: Thu, 16 Apr 2015 09:09:03 +0100
ffd6ed
Subject: [PATCH] filearch: Fix memory leak.
ffd6ed
ffd6ed
Found by 'make check-valgrind'.
ffd6ed
ffd6ed
This fixes commit 20acc1f124a3f3af365c27b7654bead5beb1ef4c.
ffd6ed
ffd6ed
(cherry picked from commit 49867a22babfed9d274294aabb1f93941793a7de)
ffd6ed
---
ffd6ed
 src/filearch.c | 2 +-
ffd6ed
 1 file changed, 1 insertion(+), 1 deletion(-)
ffd6ed
ffd6ed
diff --git a/src/filearch.c b/src/filearch.c
ffd6ed
index 40e2225..18f5918 100644
ffd6ed
--- a/src/filearch.c
ffd6ed
+++ b/src/filearch.c
ffd6ed
@@ -143,7 +143,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok,
ffd6ed
   int flags;
ffd6ed
   CLEANUP_MAGIC_T_FREE magic_t m = NULL;
ffd6ed
   const char *line;
ffd6ed
-  char *elf_arch;
ffd6ed
+  CLEANUP_FREE char *elf_arch = NULL;
ffd6ed
 
ffd6ed
   flags = g->verbose ? MAGIC_DEBUG : 0;
ffd6ed
   flags |= MAGIC_ERROR | MAGIC_RAW;
ffd6ed
-- 
ffd6ed
1.8.3.1
ffd6ed