[PATCH 1/2] Fix memory leak in __sbitmap_for_each_set function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sergey Samoylenko <s.samoylenko@xxxxxxxxx>
---
 sbitmap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sbitmap.c b/sbitmap.c
index 91a5274..4eaa0cc 100644
--- a/sbitmap.c
+++ b/sbitmap.c
@@ -272,7 +272,7 @@ static void __sbitmap_for_each_set(const struct sbitmap_context *sc,
 			if (nr >= depth)
 				break;
 			if (!fn((index << sc->shift) + nr, data))
-				return;
+				goto exit;
 
 			nr++;
 		}
@@ -282,6 +282,7 @@ next:
 			index = 0;
 	}
 
+exit:
 	FREEBUF(sbitmap_word_buf);
 }
 
-- 
2.25.1

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux