Fix a memory leak in parse_package() of repo conda
Resolves: RHEL-25496
This commit is contained in:
parent
f07df94518
commit
334959330f
@ -0,0 +1,41 @@
|
|||||||
|
From 86717630b78f015ed3e0d41aa299cdde532b9c6f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Schroeder <mls@suse.de>
|
||||||
|
Date: Fri, 21 Jul 2023 13:53:46 +0200
|
||||||
|
Subject: [PATCH] repo_conda: overwrite the package subdir with the info subdir
|
||||||
|
if there is a conflict
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
This is what classic conda does, so we also need to do it.
|
||||||
|
Fixes issue #529
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
ext/repo_conda.c | 8 ++++++++
|
||||||
|
1 file changed, 8 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/ext/repo_conda.c b/ext/repo_conda.c
|
||||||
|
index 9211cbea..356d3b11 100644
|
||||||
|
--- a/ext/repo_conda.c
|
||||||
|
+++ b/ext/repo_conda.c
|
||||||
|
@@ -314,8 +314,16 @@ parse_package(struct parsedata *pd, struct solv_jsonparser *jp, char *kfn, char
|
||||||
|
/* if we have a global subdir make sure that it matches */
|
||||||
|
if (subdir && pd->subdir && strcmp(subdir, pd->subdir) != 0)
|
||||||
|
{
|
||||||
|
+ /* we used to return an error here, but classic conda
|
||||||
|
+ * just overwrites the package subdir with the global
|
||||||
|
+ * subdir */
|
||||||
|
+#if 0
|
||||||
|
pd->error = "subdir mismatch";
|
||||||
|
return JP_ERROR;
|
||||||
|
+#else
|
||||||
|
+ solv_free(subdir);
|
||||||
|
+ subdir = solv_strdup(pd->subdir);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fn || kfn)
|
||||||
|
--
|
||||||
|
2.44.0
|
||||||
|
|
@ -37,6 +37,7 @@ Patch4: 0004-Revert-Add-more-choicerules-tests.patch
|
|||||||
Patch5: 0005-Treat-condition-both-as-positive-and-negative-litera.patch
|
Patch5: 0005-Treat-condition-both-as-positive-and-negative-litera.patch
|
||||||
Patch6: 0006-Allow_break_arch_lock_step_on_erase.patch
|
Patch6: 0006-Allow_break_arch_lock_step_on_erase.patch
|
||||||
Patch7: libsolv-0.7.24-static_analysis_fixes.patch
|
Patch7: libsolv-0.7.24-static_analysis_fixes.patch
|
||||||
|
Patch8: libsolv-0.7.24-repo_conda-overwrite-the-package-subdir-with-the-inf.patch
|
||||||
|
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -263,9 +264,10 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Apr 08 2024 David Cantrell <dcantrell@redhat.com> - 0.7.24-3
|
* Tue Apr 09 2024 Petr Pisar <ppisar@redhat.com> - 0.7.24-3
|
||||||
- Some static analysis fixes for unitialized structs
|
- Some static analysis fixes for unitialized structs
|
||||||
Resolves: RHEL-25498
|
Resolves: RHEL-25498
|
||||||
|
- Fix a memory leak in parse_package() of repo conda (RHEL-25496)
|
||||||
|
|
||||||
* Wed Jun 21 2023 Jaroslav Rohel <jrohel@redhat.com> - 0.7.24-2
|
* Wed Jun 21 2023 Jaroslav Rohel <jrohel@redhat.com> - 0.7.24-2
|
||||||
- Backport Allow to break arch lock-step on erase operations (RhBug:2172288,2172292)
|
- Backport Allow to break arch lock-step on erase operations (RhBug:2172288,2172292)
|
||||||
|
Loading…
Reference in New Issue
Block a user