diff --git a/src/jrd/opt.cpp b/src/jrd/opt.cpp index d329dc78b9..cf574709ce 100644 --- a/src/jrd/opt.cpp +++ b/src/jrd/opt.cpp @@ -3576,7 +3576,7 @@ static void find_used_streams(const RecordSource* rsb, UCHAR* streams) break; } - if (rsb->rsb_next) { + if (!found && rsb->rsb_next) { find_used_streams(rsb->rsb_next, streams); }