From 6fabbb6d7589d8cc959eaec5b6912e98b60c53ee Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 27 Mar 2026 15:48:15 -0400 Subject: [PATCH] fix: use prepare instead of prepare_cached in Filter::Execute The SQL changes every cycle due to zmDiskPercent/zmDiskBlocks/zmSystemLoad string substitution with live values, so prepare_cached never actually returns a cached handle. Instead it leaks one cache entry per distinct substituted value over the process lifetime. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/ZoneMinder/lib/ZoneMinder/Filter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm index 809851e3b..546c90516 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm @@ -100,7 +100,7 @@ sub Execute { Debug("Filter::Execute SQL ($sql)"); - my $sth = $ZoneMinder::Database::dbh->prepare_cached($sql) + my $sth = $ZoneMinder::Database::dbh->prepare($sql) or Fatal("Can't prepare '$sql': ".$ZoneMinder::Database::dbh->errstr()); my $res = $sth->execute(); if ( !$res ) {