]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsirq: fix resources leak [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 25 Mar 2021 11:13:00 +0000 (12:13 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 25 Mar 2021 11:13:00 +0000 (12:13 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/irq-common.c

index b066e4ba7f825793a25a2260d44d3756861ed09c..a5ede8028bbcbd4f01b6aca9297b1e0f044f22bf 100644 (file)
@@ -532,8 +532,10 @@ struct libscols_table *get_scols_table(struct irq_output *out,
        sort_result(out, result, stat->nr_irq);
 
        table = new_scols_table(out);
-       if (!table)
+       if (!table) {
+               free(result);
                return NULL;
+       }
 
        for (i = 0; i < stat->nr_irq; i++)
                add_scols_line(out, &result[i], table);