projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Test for NULL before calling strdup
[pspp-builds.git]
/
src
/
data
/
dictionary.c
diff --git
a/src/data/dictionary.c
b/src/data/dictionary.c
index 1c50ac7feb26976ea1e9b63d835961a5ae3db243..6e377f803212a6fbdce251ce17b36f3121e28177 100644
(file)
--- 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));