aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/SubstantialRelation.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-09-23 02:44:12 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-09-23 02:44:12 -0300
commitd65bdec20c930a3188d8e0619f861481dabe02ee (patch)
treed77992eb51545fa4d2d7f74168514f21bb22fb62 /lib/kernel/SubstantialRelation.ml
parent1af6d13048de3773149f689de3c07af96db07f1d (diff)
downloadRNT-d65bdec20c930a3188d8e0619f861481dabe02ee.tar.gz
RNT-d65bdec20c930a3188d8e0619f861481dabe02ee.zip
scan possily leaks its transaction before its first fetch
Diffstat (limited to 'lib/kernel/SubstantialRelation.ml')
-rw-r--r--lib/kernel/SubstantialRelation.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kernel/SubstantialRelation.ml b/lib/kernel/SubstantialRelation.ml
index d3f306b..ec2a01f 100644
--- a/lib/kernel/SubstantialRelation.ml
+++ b/lib/kernel/SubstantialRelation.ml
@@ -131,9 +131,9 @@ module Make (S : Abstract.Storage.STORAGE) = struct
let scan storage relation ~keep =
let open Utilities.Result in
let* tx = S.start_read storage in
- let* node = tuple_node tx relation in
let closed = ref false in
let close () = if not !closed then begin closed := true; ignore (S.abort tx) end in
+ let* node = tuple_node tx relation |> Result.map_error (fun c -> close (); c) in
(* The fold is suspended by [yield], so the tree is walked one node
and one tuple at a time rather than materialized before the
first tuple is produced. *)