[gnome-software/gnome-3-30] rpm-ostree: Fix a potential leak of a GError
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-30] rpm-ostree: Fix a potential leak of a GError
- Date: Fri, 14 Sep 2018 14:28:28 +0000 (UTC)
commit 9b7aff9c583855c919d51c835055e0b5d3bad49c
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]