Add patch to fix a double-free

36c5e90469

Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
This commit is contained in:
Ernestas Kulik 2019-11-11 11:21:51 +01:00
parent baf3eb10e5
commit d65da2513b
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 36c5e90469b36cb0724f45447ae923a6d6ccf348 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= <mgrabovs@redhat.com>
Date: Fri, 25 Oct 2019 12:37:44 +0200
Subject: [PATCH] gtk: Fix another possible double-free
The object should only be freed if we're in the cleanup phase, i.e. only
in the if-branch of the condition.
This one was introduced in dc281652.
---
src/gui-wizard-gtk/wizard.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 4b840bac..ec8bb68b 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -2518,7 +2518,7 @@ static bool highligh_words_in_textview(int page, GtkTextView *tev, GList *words,
while (valid)
{
g_autofree char *text = NULL;
- g_autofree search_item_t *word = NULL;
+ search_item_t *word = NULL;
gtk_tree_model_get(GTK_TREE_MODEL(g_ls_sensitive_list), &iter,
SEARCH_COLUMN_TEXT, &text,
@@ -2533,6 +2533,8 @@ static bool highligh_words_in_textview(int page, GtkTextView *tev, GList *words,
if (word == g_current_highlighted_word)
g_current_highlighted_word = NULL;
+
+ free(word);
}
else
{
--
2.23.0

View File

@ -15,7 +15,7 @@
Summary: Generic library for reporting various problems Summary: Generic library for reporting various problems
Name: libreport Name: libreport
Version: 2.11.2 Version: 2.11.2
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2+ License: GPLv2+
URL: https://abrt.readthedocs.org/ URL: https://abrt.readthedocs.org/
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
@ -63,6 +63,8 @@ Requires: lz4
BuildRequires: sed BuildRequires: sed
%endif %endif
Patch0: 0001-gtk-Fix-another-possible-double-free.patch
%description %description
Libraries providing API for reporting different problems in applications Libraries providing API for reporting different problems in applications
to different bug targets like Bugzilla, ftp, trac, etc... to different bug targets like Bugzilla, ftp, trac, etc...
@ -749,6 +751,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif %endif
%changelog %changelog
* Mon Nov 11 2019 Ernestas Kulik <ekulik@redhat.com> - 2.11.2-2
- Add patch to fix a double-free
* Wed Oct 23 2019 Matěj Grabovský <mgrabovs@redhat.com> 2.11.2-1 * Wed Oct 23 2019 Matěj Grabovský <mgrabovs@redhat.com> 2.11.2-1
- gtk: Improve memory management - gtk: Improve memory management
- gtk: Prevent memory leak - gtk: Prevent memory leak