Do not unref LrErr_Exception on exit (RhBug:1778854)

This commit is contained in:
Lukas Slebodnik 2020-02-05 13:31:19 +01:00 committed by Lukas Slebodnik
parent 8bcaf6c177
commit 7193ef616a
2 changed files with 32 additions and 1 deletions

27
180.patch Normal file
View File

@ -0,0 +1,27 @@
From c7d2f38c06039798f998c7c83685b1b44ffd24d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hr=C3=A1zk=C3=BD?= <lhrazky@redhat.com>
Date: Thu, 16 Jan 2020 17:32:29 +0100
Subject: [PATCH] Do not unref LrErr_Exception on exit (RhBug:1778854)
It seems the reference to a Python exception obtained from
PyErr_NewException is borrowed and is not meant to be decref'd on
exit. From valgrind output Python frees the memory allocated for these
itself.
https://bugzilla.redhat.com/show_bug.cgi?id=1778854
---
librepo/python/librepomodule.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/librepo/python/librepomodule.c b/librepo/python/librepomodule.c
index 231a8cf..3d52893 100644
--- a/librepo/python/librepomodule.c
+++ b/librepo/python/librepomodule.c
@@ -134,7 +134,6 @@ exit_librepo(void)
{
Py_XDECREF(debug_cb);
Py_XDECREF(debug_cb_data);
- Py_XDECREF(LrErr_Exception);
}
struct module_state {

View File

@ -27,12 +27,13 @@
Name: librepo
Version: 1.11.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Repodata downloading library
License: LGPLv2+
URL: https://github.com/rpm-software-management/librepo
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch01: 180.patch
BuildRequires: cmake
BuildRequires: gcc
@ -189,6 +190,9 @@ popd
%endif
%changelog
* Wed Feb 05 2020 Lukas Slebodnik <lslebodn@fedoraproject.org> - 1.11.1-3
- Do not unref LrErr_Exception on exit (RhBug:1778854)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild