Browse code

mhtml: reader memory fixes

Kevin Lin authored on 2016/05/27 05:30:27
Showing 1 changed files
... ...
@@ -1284,6 +1284,8 @@ parseRootMHTML(mbox_ctx *mctx, message *m, text *t)
1284 1284
 		rc = FAIL;
1285 1285
 	}
1286 1286
 
1287
+	xmlTextReaderClose(reader);
1288
+	xmlFreeTextReader(reader);
1287 1289
 	xmlFreeDoc(htmlDoc);
1288 1290
 	blobDestroy(input);
1289 1291
 	return rc;
... ...
@@ -3841,10 +3843,10 @@ do_multipart(message *mainMessage, message **messages, int i, mbox_status *rc, m
3841 3841
 	const int doPhishingScan = mctx->ctx->engine->dboptions&CL_DB_PHISHING_URLS && (DCONF_PHISHING&PHISHING_CONF_ENGINE);
3842 3842
 #if HAVE_JSON
3843 3843
 	const char *mtype = NULL;
3844
-	json_object *multiobj, *thisobj, *saveobj = mctx->wrkobj;
3844
+	json_object *thisobj = NULL, *saveobj = mctx->wrkobj;
3845 3845
 
3846 3846
 	if (mctx->wrkobj != NULL) {
3847
-		multiobj = cli_jsonarray(mctx->wrkobj, "Multipart");
3847
+		json_object *multiobj = cli_jsonarray(mctx->wrkobj, "Multipart");
3848 3848
 		if (multiobj == NULL) {
3849 3849
 			cli_errmsg("Cannot get multipart preclass array\n");
3850 3850
 			*rc = -1;