From: dms Date: Mon, 2 Oct 2000 17:26:16 +0000 (+0000) Subject: added sth->finish in an attempt to prevent leaks X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d8b04f4757efe62c0f9c3537bf581f2502e7adcf;p=infobot.git added sth->finish in an attempt to prevent leaks git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@152 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/db_mysql.pl b/blootbot/src/db_mysql.pl index e805556..545abf1 100644 --- a/blootbot/src/db_mysql.pl +++ b/blootbot/src/db_mysql.pl @@ -58,7 +58,8 @@ sub dbGet { if (!$sth->execute) { &ERROR("Get => '$query'"); &ERROR("Get => $DBI::errstr"); - return; + $sth->finish; + return 0; } my @retval = $sth->fetchrow_array; @@ -86,6 +87,7 @@ sub dbGetCol { if (!$sth->execute) { &ERROR("GetCol => '$query'"); &ERROR("GetCol => $DBI::errstr"); + $sth->finish; return; } @@ -118,6 +120,8 @@ sub dbGetRowInfo { if (!$sth->execute) { &ERROR("GRI => '$query'"); &ERROR("GRI => $DBI::errstr"); + $sth->finish; + return; } my @cols; @@ -223,6 +227,7 @@ sub dbRaw { if (!$sth->execute) { &ERROR("Raw($prefix): => '$query'"); &ERROR("Raw($prefix): $DBI::errstr"); + $sth->finish; return 0; }