From b0269e285ccdf7acb8d6231f29d85b56cfdd676c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 8 Jan 2021 22:18:12 -0800 Subject: [PATCH] pivot-table: Tolerate nulls in pivot_value_clone(). These members should not be null, but there is little cost and perhaps some benefit in allowing it. --- src/output/pivot-table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index 01a4a859f1..aa3b9b51c2 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -2483,10 +2483,10 @@ pivot_value_clone (const struct pivot_value *old) case PIVOT_VALUE_TEXT: new->text.local = xstrdup (old->text.local); new->text.c = (old->text.c == old->text.local ? new->text.local - : xstrdup (old->text.c)); + : xstrdup_if_nonnull (old->text.c)); new->text.id = (old->text.id == old->text.local ? new->text.local : old->text.id == old->text.c ? new->text.c - : xstrdup (old->text.id)); + : xstrdup_if_nonnull (old->text.id)); break; case PIVOT_VALUE_TEMPLATE: -- 2.30.2