com php-src: Prevent fd leak in readdir_r that causes f alse negative on readdir_r implementation when co mpiled with AddressSanitizer: acinclude.m4

From: Date: Tue, 10 Jan 2017 11:51:27 +0000
Subject: com php-src: Prevent fd leak in readdir_r that causes f alse negative on readdir_r implementation when co mpiled with AddressSanitizer: acinclude.m4
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96656@lists.php.net to get a copy of this message
Commit: 1bdffee820d92f558d883bd1aa41bebc739e2980 Author: Ondřej Surý <ondrej@sury.org> Tue, 10 Jan 2017 10:21:54 +0100 Committer: Joe Watkins <krakjoe@php.net> Tue, 10 Jan 2017 11:51:27 +0000 Parents: 125ee6a68e40d539cac5eb97def04d1586ce0e5d Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1bdffee820d92f558d883bd1aa41bebc739e2980 Log: Prevent fd leak in readdir_r that causes false negative on readdir_r implementation when compiled with AddressSanitizer Changed paths: M acinclude.m4 Diff: diff --git a/acinclude.m4 b/acinclude.m4 index 234dcd7..36bd1c2 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1376,8 +1376,11 @@ main() { dir = opendir("/"); if (!dir) exit(1); - if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) + if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) { + close(dir); exit(0); + } + close(dir); exit(1); } ],[

« previous php.cvs (#96656) next »