From 3393b6c0fe4006c0b17be9e9e999b753ce2b7d92 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 27 Mar 2009 13:55:26 +0900 Subject: [PATCH] Test for NULL before calling strdup --- src/data/dictionary.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); -- 2.30.2