Skip to content

Commit 4b0fae2

Browse files
committed
Lib: Fixed resource leak with cURL
Added missing curl_close() call. Because it removes the handler, store the error number and text before closing so they can used in throwing an exception.
1 parent 3d84901 commit 4b0fae2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

quickbase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,13 @@ final public function transmit(){
261261

262262
$response = curl_exec($ch);
263263

264+
$errno = curl_errno($ch);
265+
$error = curl_error($ch);
266+
267+
curl_close($ch);
268+
264269
if($response === false){
265-
throw new QuickBaseError(curl_errno($ch), curl_error($ch));
270+
throw new QuickBaseError($errno, $error);
266271
}
267272

268273
$this->xmlResponse = new SimpleXmlIterator($response);

0 commit comments

Comments
 (0)