From: John Darrington Date: Fri, 27 Mar 2009 04:55:26 +0000 (+0900) Subject: Test for NULL before calling strdup X-Git-Tag: v0.7.3~197 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3393b6c0fe4006c0b17be9e9e999b753ce2b7d92;p=pspp-builds.git Test for NULL before calling strdup --- diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 1c50ac7f..6e377f80 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -211,7 +211,8 @@ dict_clone (const struct dictionary *s) for (i = 0; i < s->vector_cnt; i++) d->vector[i] = vector_clone (s->vector[i], s, d); - d->encoding = strdup (s->encoding); + if ( s->encoding) + d->encoding = strdup (s->encoding); dict_set_attributes (d, dict_get_attributes (s));