dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

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

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