projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
dictionary: Fix memory leak in dict_set_encoding().
[pspp]
/
src
/
data
/
dictionary.c
diff --git
a/src/data/dictionary.c
b/src/data/dictionary.c
index f69d91e3605ed246302740c74e1cb2f47ef3d8f7..bca92dabe300b4c34439845c47abf485c900a778 100644
(file)
--- a/
src/data/dictionary.c
+++ b/
src/data/dictionary.c
@@
-81,7
+81,10
@@
void
dict_set_encoding (struct dictionary *d, const char *enc)
{
if (enc)
- d->encoding = xstrdup (enc);
+ {
+ free (d->encoding);
+ d->encoding = xstrdup (enc);
+ }
}
const char *