LibC: Don't leak fds on rename
This commit is contained in:
@@ -857,6 +857,9 @@ int rename(const char* old, const char* _new)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close(new_fd);
|
||||||
|
close(old_fd);
|
||||||
|
|
||||||
unlink(old);
|
unlink(old);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user