From 62e423f7593ab684c20a6381e2e098b97772746d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 25 Nov 2022 12:13:41 -0800 Subject: [PATCH] pivot-table: Fix memory leak in debug print code. --- src/output/pivot-table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index 93dc74c2d8..1a200f75c0 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -1964,7 +1964,10 @@ compose_headings (const struct pivot_table *pt, { headings[row][column] = pivot_value_to_string (c->name, pt); if (!*headings[row][column]) - headings[row][column] = xstrdup (""); + { + free (headings[row][column]); + headings[row][column] = xstrdup (""); + } row--; } } -- 2.30.2