chantra / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0007-Fix-removal-step-during-modular-enable-in-context-part.patch

208e85
From 831d023c3c6fb4a28903cb3170efdd9f85645e1a Mon Sep 17 00:00:00 2001
208e85
From: Jaroslav Mracek <jmracek@redhat.com>
208e85
Date: Fri, 20 Nov 2020 16:30:17 +0100
208e85
Subject: [PATCH] Fix removal step during modular enable in context part
208e85
208e85
It resolves `free(): double free detected in tcache 2`
208e85
---
208e85
 libdnf/dnf-context.cpp | 2 +-
208e85
 1 file changed, 1 insertion(+), 1 deletion(-)
208e85
208e85
diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp
208e85
index 069267119..bc4a15b68 100644
208e85
--- a/libdnf/dnf-context.cpp
208e85
+++ b/libdnf/dnf-context.cpp
208e85
@@ -3087,7 +3087,7 @@ static std::vector
208e85
             }
208e85
             for (auto iter = stream_dict.begin(); iter != stream_dict.end(); ) {
208e85
                 if (iter->first != enabledOrDefaultStream) {
208e85
-                    stream_dict.erase(iter);
208e85
+                    stream_dict.erase(iter++);
208e85
                 } else {
208e85
                     ++iter;
208e85
                 }