From f3c1502c83f5ae09202a707669c924fc2bd0cca4 Mon Sep 17 00:00:00 2001 From: liuchao173 Date: Mon, 18 Nov 2019 13:57:11 +0000 Subject: [PATCH] irqblance: fix memory leak of strdup fix memory leak of strdup in collect_full_irq_list(), when continue in if branch, the savedline isn't freed --- procinterrupts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/procinterrupts.c b/procinterrupts.c index e36fcac..bde31f4 100644 --- a/procinterrupts.c +++ b/procinterrupts.c @@ -321,6 +321,7 @@ GList* collect_full_irq_list() if (ban_pci_assigned_irq && is_pci_assigned_irq(c)) { log(TO_ALL, LOG_INFO, "Banned PCI-assigned irq %d.\n", number); add_vm_banned_irq(number); + free(savedline); continue; } @@ -338,6 +339,7 @@ GList* collect_full_irq_list() * For these irqs, we can add these to banned irq list. */ add_banned_list_irq(number); + free(savedline); continue; } #endif -- 2.19.1