summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-12-24 10:52:38 +0000
committerErmal <eri@pfsense.org>2013-12-24 10:52:38 +0000
commit15bec71856363fcf85799e54dfaa5aa55e88bd81 (patch)
tree5a29bc955b8b9243c6b0acaf3c19801b45aa20da /etc/inc/voucher.inc
parent1f965b69a89df2671b49033153c063e8ca8672ed (diff)
downloadpfsense-15bec71856363fcf85799e54dfaa5aa55e88bd81.zip
pfsense-15bec71856363fcf85799e54dfaa5aa55e88bd81.tar.gz
While here unset some variables even on vouchers side
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc14
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index a2baae9..1402aa5 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -245,8 +245,9 @@ function voucher_expire($voucher_received) {
if (strlen($voucher) < 3)
continue; // seems too short to be a voucher!
- $result = exec("/usr/local/bin/voucher -c {$g['varetc_path']}/voucher_{$cpzone}.cfg -k {$g['varetc_path']}/voucher_{$cpzone}.public -- $v");
- list($status, $roll, $nr) = explode(" ", $result);
+ unset($output);
+ $_gb = exec("/usr/local/bin/voucher -c {$g['varetc_path']}/voucher_{$cpzone}.cfg -k {$g['varetc_path']}/voucher_{$cpzone}.public -- $v", $output);
+ list($status, $roll, $nr) = explode(" ", $output[0]);
if ($status == "OK") {
// check if we have this ticket on a registered roll for this ticket
if ($tickets_per_roll[$roll] && ($nr <= $tickets_per_roll[$roll])) {
@@ -279,13 +280,14 @@ function voucher_expire($voucher_received) {
captiveportal_syslog("$voucher ($roll/$nr): not found on any registererd Roll");
} else
// hmm, thats weird ... not what I expected
- captiveportal_syslog("$voucher invalid: $result !!");
+ captiveportal_syslog("$voucher invalid: {$output[0]}!!");
}
// Refresh active DBs
if ($active_dirty == true) {
foreach ($active_vouchers as $roll => $active)
voucher_write_active_db($roll, $active);
+ unset($active_vouchers);
/* Triger a sync of the vouchers on config */
send_event("service sync vouchers");
@@ -301,6 +303,7 @@ function voucher_expire($voucher_received) {
voucher_write_used_db($roll, base64_encode($used));
}
}
+ unset($bitstring);
}
unlock($voucherlck);
@@ -635,7 +638,9 @@ function voucher_used_count($roll) {
$mask = 1 << ($i % 8); // mask to test bit in octet
if (ord($bitstring[$pos]) & $mask)
$used++;
- }
+ }
+ unset($bitstring);
+
return $used;
}
@@ -715,6 +720,7 @@ function voucher_save_db_to_config_zone() {
$dbi++;
}
$rollent['active'] = $db;
+ unset($active_vouchers);
}
unlock($voucherlck);
OpenPOWER on IntegriCloud