From: Chang, Harry Date: Thu, 20 Jun 2019 00:59:18 +0000 (+0800) Subject: Do not free stream unless hs_close_stream returns success. X-Git-Tag: v5.2.0^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bfbf07f75411924626910970de89405ce2a9605;p=thirdparty%2Fvectorscan.git Do not free stream unless hs_close_stream returns success. (by unit-hyperscan HyperscanArgChecks.CloseStreamNoScratch) --- diff --git a/src/runtime.c b/src/runtime.c index 078c8821..ed1eaf53 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -1006,17 +1006,14 @@ hs_error_t HS_CDECL hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch, if (onEvent) { if (!scratch || !validScratch(id->rose, scratch)) { - hs_stream_free(id); return HS_INVALID; } if (unlikely(markScratchInUse(scratch))) { - hs_stream_free(id); return HS_SCRATCH_IN_USE; } report_eod_matches(id, scratch, onEvent, context); if (unlikely(internal_matching_error(scratch))) { unmarkScratchInUse(scratch); - hs_stream_free(id); return HS_UNKNOWN_ERROR; } unmarkScratchInUse(scratch);