1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 15:18:16 +00:00

Fix hc_path_create(), first close the file descriptor before unlinking the file itself

This commit is contained in:
jsteube 2017-02-14 16:12:18 +01:00
parent ee96546cd7
commit 671f9a7eb7

View File

@ -246,7 +246,11 @@ bool hc_path_create (const char *path)
{ {
if (hc_path_exist (path) == true) return false; if (hc_path_exist (path) == true) return false;
if (creat (path, S_IRUSR | S_IWUSR) == -1) return false; const int fd = creat (path, S_IRUSR | S_IWUSR);
if (fd == -1) return false;
close (fd);
unlink (path); unlink (path);