From e258f7ccec2856e0c65a50e794d8bbda29a32eab Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 8 May 2010 17:49:47 +0000 Subject: [PATCH] mysql_free_result() frees memory but does not set pointer to nil. Do that by hand, so later checks for nil don't run into AVs. Probably fixes issue #1901. --- source/mysql_connection.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/mysql_connection.pas b/source/mysql_connection.pas index ffb2746f..752d6a63 100644 --- a/source/mysql_connection.pas +++ b/source/mysql_connection.pas @@ -640,8 +640,10 @@ begin FRowsFound := mysql_num_rows(Result); FRowsAffected := 0; Log(lcDebug, IntToStr(RowsFound)+' rows found.'); - if not DoStoreResult then + if not DoStoreResult then begin mysql_free_result(Result); + Result := nil; + end; // No support for real multi results yet, throw them away, so mysql_ping() does not crash on the *next* query. i := 1;