From: Hong, Yang A Date: Wed, 19 Oct 2022 16:50:02 +0000 (+0000) Subject: stream close: free stream to avoid memory leak X-Git-Tag: vectorscan/5.4.10~1^2~2^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=659525480c1093f217e1a3055705caf391c50e7c;p=thirdparty%2Fvectorscan.git stream close: free stream to avoid memory leak fix github issue #303 --- diff --git a/src/runtime.c b/src/runtime.c index a3659348..ab46db1a 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -1013,6 +1013,7 @@ hs_error_t HS_CDECL hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch, 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);