From: Ben Pfaff Date: Sat, 9 Jan 2021 06:18:12 +0000 (-0800) Subject: pivot-table: Tolerate nulls in pivot_value_clone(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0269e285ccdf7acb8d6231f29d85b56cfdd676c;p=pspp 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. --- 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: