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) <noreply@anthropic.com>
This commit is contained in:
Isaac Connor
2026-03-27 15:48:15 -04:00
parent 62ef4014ad
commit 6fabbb6d75

View File

@@ -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 ) {