dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

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

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