]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
stream close: free stream to avoid memory leak
authorHong, Yang A <yang.a.hong@intel.com>
Wed, 19 Oct 2022 16:50:02 +0000 (16:50 +0000)
committerKonstantinos Margaritis <markos@freevec.org>
Tue, 5 Sep 2023 10:50:56 +0000 (13:50 +0300)
fix github issue #303

src/runtime.c

index a3659348c529c4a008457c287bdd9cd71199a6a0..ab46db1a612f6aa02ff258efe515eede6f52a306 100644 (file)
@@ -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);