1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

lib:replace: Fix possible resource leaks in test_closefrom()

Found by covscan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Apr 25 22:02:20 UTC 2021 on sn-devel-184
This commit is contained in:
Andreas Schneider 2021-04-22 15:25:57 +02:00 committed by Jeremy Allison
parent a9ad677eb8
commit 16d1abb63e

View File

@ -1089,6 +1089,7 @@ static bool test_closefrom(void)
fd = dup(0);
if (fd == -1) {
perror("dup failed");
closefrom(3);
return false;
}
@ -1096,6 +1097,7 @@ static bool test_closefrom(void)
if (fd >= 1000) {
printf("fd=%d\n", fd);
closefrom(3);
return false;
}
}