[LIBREPORT PATCH] do not leak file rhbz#997871

Jiri Moskovcak jmoskovc at redhat.com
Fri Aug 16 11:03:13 UTC 2013


Signed-off-by: Jiri Moskovcak <jmoskovc at redhat.com>
---
 src/plugins/reporter-rhtsupport.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
index bbf0a1e..4598790 100644
--- a/src/plugins/reporter-rhtsupport.c
+++ b/src/plugins/reporter-rhtsupport.c
@@ -132,6 +132,9 @@ int create_tarball(const char *tempfile, problem_data_t *problem_data)
         free(block);
     }
 
+    /* now it's safe to free file */
+    free_reportfile(file);
+
     /* We must be sure gzip finished, and finished successfully */
     int status;
     safe_waitpid(child, &status, 0);
@@ -159,7 +162,6 @@ int create_tarball(const char *tempfile, problem_data_t *problem_data)
         safe_waitpid(child, NULL, 0);
     }
 
-    free_reportfile(file);
     return 1; /* failure */
 }
 
-- 
1.8.3.1



More information about the Crash-catcher mailing list