From 5625078cfe9d47b2089b4dc1b9268313f3471582 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Tue, 4 Feb 2020 17:16:10 +0100 Subject: [PATCH] [ticket/16348] Prevent double freeing database results on user_ban PHPBB3-16348 --- phpBB/includes/functions_user.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index e0b6a9d0c6..0eaf9c2e18 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1046,13 +1046,15 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $banlist_ary[] = (int) $row['user_id']; } while ($row = $db->sql_fetchrow($result)); + + $db->sql_freeresult($result); } else { $db->sql_freeresult($result); + trigger_error('NO_USERS', E_USER_WARNING); } - $db->sql_freeresult($result); break; case 'ip':