From 5aa4bd565fb1eef6c0ef1b04f6c823e6503bd5b4 Mon Sep 17 00:00:00 2001 From: "Hong, Yang A" Date: Wed, 19 Oct 2022 16:50:02 +0000 Subject: [PATCH] stream close: free stream to avoid memory leak fix github issue #303 --- src/runtime.c | 1 + 1 file changed, 1 insertion(+) 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);