projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
503f53b
)
Test for NULL before calling strdup
author
John Darrington
<john@darrington.wattle.id.au>
Fri, 27 Mar 2009 04:55:26 +0000
(13:55 +0900)
committer
John Darrington
<john@darrington.wattle.id.au>
Fri, 27 Mar 2009 04:55:26 +0000
(13:55 +0900)
src/data/dictionary.c
patch
|
blob
|
history
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));