summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-01-10 17:39:22 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2014-01-10 17:39:22 (GMT)
commita16bb86f102dcab0c24fc6ab904d48afd8d0d9fd (patch)
treef9cf492b86fe357aafc8eacdca74a7cceebd3fe9
parent8e48b931091cbc99abeffacc7af80f363495ec23 (diff)
downloadlibparserutils-a16bb86f102dcab0c24fc6ab904d48afd8d0d9fd.tar.gz
libparserutils-a16bb86f102dcab0c24fc6ab904d48afd8d0d9fd.tar.bz2
Fix leak. Thanks to Ralf Junker.
-rw-r--r--src/input/inputstream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/input/inputstream.c b/src/input/inputstream.c
index da6653c..b2a1048 100644
--- a/src/input/inputstream.c
+++ b/src/input/inputstream.c
@@ -101,8 +101,13 @@ parserutils_error parserutils_inputstream_create(const char *enc,
s->mibenum =
parserutils_charset_mibenum_from_name(enc, strlen(enc));
- if (s->mibenum == 0)
+ if (s->mibenum == 0) {
+ parserutils__filter_destroy(s->input);
+ parserutils_buffer_destroy(s->public.utf8);
+ parserutils_buffer_destroy(s->raw);
+ free(s);
return PARSERUTILS_BADENCODING;
+ }
params.encoding.name = enc;