diff mbox series

[22/34] kernelshark: Fix potential double free of histo->map, histo->bin_count

Message ID 20240114171723.14092-23-dev@benjarobin.fr (mailing list archive)
State Accepted
Commit 37e1ea98b5920cac327b90273ae70d84ad86966d
Headers show
Series Fix kernelshark issues introduced by the migration to Qt6 | expand

Commit Message

Benjamin ROBIN Jan. 14, 2024, 5:17 p.m. UTC
Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr>
---
 src/libkshark-model.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/libkshark-model.c b/src/libkshark-model.c
index 44f829d..4cd9f6a 100644
--- a/src/libkshark-model.c
+++ b/src/libkshark-model.c
@@ -104,7 +104,8 @@  static void ksmodel_set_in_range_bining(struct kshark_trace_histo *histo,
 
 		free(histo->bin_count);
 		free(histo->map);
-
+		histo->map = NULL;
+		histo->bin_count = NULL;
 		return;
 	}