move the mysql_free_result, looks like we can't free it until we free the row

This commit is contained in:
Isaac Connor 2016-04-20 09:44:11 -04:00
parent 3e683e3002
commit d2870f0692
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}