Skip to content

Commit 322e943

Browse files
author
Tim Wichmann
committed
Close curl resource after error is been read
Signed-off-by: Tim Wichmann <tim@wichmann.online>
1 parent 8fda524 commit 322e943

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/imap.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public function checkPassword($uid, $password) {
9595

9696
$canconnect = curl_exec($ch);
9797
$info = curl_getinfo($ch);
98-
curl_close($ch);
9998

10099
if($canconnect) {
100+
curl_close($ch);
101101
$uid = mb_strtolower($uid);
102102
$this->storeUser($uid, $groups);
103103
return $uid;
@@ -108,6 +108,8 @@ public function checkPassword($uid, $password) {
108108
);
109109
}
110110

111+
curl_close($ch);
112+
111113
return false;
112114
}
113115
}

0 commit comments

Comments
 (0)