diff --git a/libclamav/ooxml.c b/libclamav/ooxml.c index 207eef508..c262d3aaa 100644 --- a/libclamav/ooxml.c +++ b/libclamav/ooxml.c @@ -435,6 +435,8 @@ static int ooxml_parse_document(int fd, cli_ctx *ctx) /* move reader to first element */ if (xmlTextReaderRead(reader) != 1) { + xmlTextReaderClose(reader); + xmlFreeTextReader(reader); return CL_SUCCESS; /* libxml2 failed */ }