Blame SOURCES/0001-Fix-cr_compress_file_with_stat-Memory-leak.patch

444c2a
From 1ec1e767e4a48bc2c1d09b52da9e749352f8d925 Mon Sep 17 00:00:00 2001
444c2a
From: Jaroslav Rohel <jrohel@redhat.com>
444c2a
Date: Thu, 6 May 2021 19:09:19 +0200
444c2a
Subject: [PATCH] Fix: cr_compress_file_with_stat: Memory leak
444c2a
444c2a
---
444c2a
 src/misc.c | 2 ++
444c2a
 1 file changed, 2 insertions(+)
444c2a
444c2a
diff --git a/src/misc.c b/src/misc.c
444c2a
index e5350ac..59c04e6 100644
444c2a
--- a/src/misc.c
444c2a
+++ b/src/misc.c
444c2a
@@ -503,6 +503,8 @@ cr_compress_file_with_stat(const char *src,
444c2a
     if (!orig) {
444c2a
         ret = tmp_err->code;
444c2a
         g_propagate_prefixed_error(err, tmp_err, "Cannot open %s: ", src);
444c2a
+        if (dst != in_dst)
444c2a
+            g_free(dst);
444c2a
         return ret;
444c2a
     }
444c2a
 
444c2a
--
444c2a
libgit2 1.0.1
444c2a