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:
DL6ER
2020-05-14 18:37:08 +02:00
parent 8c53844ef3
commit fe10059517
2 changed files with 5 additions and 0 deletions

View File

@@ -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) {