projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leak in SYSFILE command
[pspp]
/
src
/
language
/
dictionary
/
sys-file-info.c
diff --git
a/src/language/dictionary/sys-file-info.c
b/src/language/dictionary/sys-file-info.c
index 862d989a6b8d2c521870126079aa7f09cfa1928c..92ade932ef17384fdde49786ffbf9bee71293d82 100644
(file)
--- a/
src/language/dictionary/sys-file-info.c
+++ b/
src/language/dictionary/sys-file-info.c
@@
-133,7
+133,10
@@
cmd_sysfile_info (struct lexer *lexer, struct dataset *ds UNUSED)
any_reader = any_reader_open (h);
if (!any_reader)
any_reader = any_reader_open (h);
if (!any_reader)
- return CMD_FAILURE;
+ {
+ free (encoding);
+ return CMD_FAILURE;
+ }
if (encoding && !strcasecmp (encoding, "detect"))
{
if (encoding && !strcasecmp (encoding, "detect"))
{
@@
-150,7
+153,8
@@
cmd_sysfile_info (struct lexer *lexer, struct dataset *ds UNUSED)
report_encodings (h, pool, titles, ids, strings, n_strings);
fh_unref (h);
pool_destroy (pool);
report_encodings (h, pool, titles, ids, strings, n_strings);
fh_unref (h);
pool_destroy (pool);
-
+ free (encoding);
+
return CMD_SUCCESS;
}
return CMD_SUCCESS;
}
@@
-249,6
+253,7
@@
cmd_sysfile_info (struct lexer *lexer, struct dataset *ds UNUSED)
dict_destroy (d);
fh_unref (h);
dict_destroy (d);
fh_unref (h);
+ free (encoding);
any_read_info_destroy (&info);
return CMD_SUCCESS;
any_read_info_destroy (&info);
return CMD_SUCCESS;