mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 02:39:25 +01:00
Finalize sub-queries to ensure we're not running out of memory with hundreds of clients (can result in O(N^2) memory requirements).
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -194,6 +194,7 @@ if ($_POST['action'] == 'get_groups') {
|
||||
while ($gres = $group_query->fetchArray(SQLITE3_ASSOC)) {
|
||||
array_push($groups, $gres['group_id']);
|
||||
}
|
||||
$group_query->finalize();
|
||||
$res['groups'] = $groups;
|
||||
array_push($data, $res);
|
||||
}
|
||||
@@ -222,6 +223,7 @@ if ($_POST['action'] == 'get_groups') {
|
||||
while ($res_names = $query_names->fetchArray(SQLITE3_ASSOC)) {
|
||||
array_push($names, utf8_encode($res_names["name"]));
|
||||
}
|
||||
$query_names->finalize();
|
||||
$extrainfo = "";
|
||||
// Add device vendor to info string (if available)
|
||||
if (strlen($res["macVendor"]) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user