From d2870f06928b0975fca082c58649c5260ba45394 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 20 Apr 2016 09:44:11 -0400 Subject: [PATCH] move the mysql_free_result, looks like we can't free it until we free the row --- src/zm_db.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_db.cpp b/src/zm_db.cpp index a342ca14b..bc15d9ec6 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -100,12 +100,13 @@ MYSQL_ROW zmDbFetchOne( const char *query ) { int n_rows = mysql_num_rows( result ); if ( n_rows != 1 ) { Error( "Bogus number of lines return from query, %d returned for query %s.", n_rows, query ); + mysql_free_result( result ); return NULL; } MYSQL_ROW dbrow = mysql_fetch_row( result ); - mysql_free_result( result ); if ( ! dbrow ) { + mysql_free_result( result ); Error("Error getting row from query %s. Error is %s", query, mysql_error( &dbconn ) ); return NULL; }