Blob Blame History Raw
From 854119bb3cd790333cd7ed135fdc5c9cdca1d551 Mon Sep 17 00:00:00 2001
From: Aleš Matěj <amatej@redhat.com>
Date: Tue, 28 May 2019 15:07:11 +0200
Subject: [PATCH] Fix minor memory leaks, RhBug:1702283

---
 dnf/dnf-utils.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dnf/dnf-utils.c b/dnf/dnf-utils.c
index ea067ad..14f1667 100644
--- a/dnf/dnf-utils.c
+++ b/dnf/dnf-utils.c
@@ -48,7 +48,9 @@ dnf_utils_add_transaction_packages (struct libscols_table *tb,
       struct libscols_line *ln = scols_table_new_line (tb, parent);
       scols_line_set_data (ln, COL_NEVRA, dnf_package_get_nevra (pkg));
       scols_line_set_data (ln, COL_REPO, dnf_package_get_reponame (pkg));
-      scols_line_set_data (ln, COL_SIZE, g_format_size (dnf_package_get_size (pkg)));
+      char *formatted_pkg_size = g_format_size (dnf_package_get_size (pkg));
+      scols_line_set_data (ln, COL_SIZE, formatted_pkg_size);
+      g_free(formatted_pkg_size);
     }
 }
 
@@ -135,6 +137,7 @@ dnf_utils_print_transaction (DnfContext *ctx)
     }
 
   scols_print_table (tb);
+  scols_unref_symbols (sb);
   scols_unref_table (tb);
 
   g_print ("Transaction Summary:\n");
--
libgit2 0.27.8