mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 07:08:19 +00:00
Fix hc_path_create(), first close the file descriptor before unlinking the file itself
This commit is contained in:
parent
ee96546cd7
commit
671f9a7eb7
@ -246,7 +246,11 @@ bool hc_path_create (const char *path)
|
||||
{
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user