Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c9a0355

Browse filesBrowse files
committed
[HttpCache] Unlink tmp file on error
1 parent 509142e commit c9a0355
Copy full SHA for c9a0355

File tree

1 file changed

+6
-0
lines changed
Filter options
  • src/Symfony/Component/HttpKernel/HttpCache

1 file changed

+6
-0
lines changed

‎src/Symfony/Component/HttpKernel/HttpCache/Store.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/HttpCache/Store.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,16 +387,22 @@ private function save($key, $data)
387387

388388
$tmpFile = tempnam(dirname($path), basename($path));
389389
if (false === $fp = @fopen($tmpFile, 'wb')) {
390+
@unlink($tmpFile);
391+
390392
return false;
391393
}
392394
@fwrite($fp, $data);
393395
@fclose($fp);
394396

395397
if ($data != file_get_contents($tmpFile)) {
398+
@unlink($tmpFile);
399+
396400
return false;
397401
}
398402

399403
if (false === @rename($tmpFile, $path)) {
404+
@unlink($tmpFile);
405+
400406
return false;
401407
}
402408
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.