[gnome-software] rpm-ostree: Fix a potential leak of a GError



commit bdfebb84b28b7cf39d5be3bfb1b35054b3a3b79e
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Aug 7 13:27:54 2018 +0100

    rpm-ostree: Fix a potential leak of a GError
    
    If the GError was somehow set but not propagated, it would leak.
    
    This has not been observed in the wild.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
index d4971aba..a25802a7 100644
--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
+++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
@@ -203,6 +203,7 @@ static void
 transaction_progress_free (TransactionProgress *self)
 {
        g_main_loop_unref (self->loop);
+       g_clear_error (&self->error);
        g_slice_free (TransactionProgress, self);
 }
 
@@ -300,7 +301,7 @@ gs_rpmostree_transaction_get_response_sync (GsRPMOSTreeSysroot *sysroot_proxy,
 
        if (!g_cancellable_set_error_if_cancelled (cancellable, error)) {
                if (tp->error) {
-                       g_propagate_error (error, tp->error);
+                       g_propagate_error (error, g_steal_pointer (&tp->error));
                } else {
                        success = TRUE;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]