mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Fix an fd leak in check_private_dir().
The fd would leak when the User wasn't recogniezed by getpwnam(). Since we'd then go on to exit, this wasn't a terribad leak, but it's still not as nice as no leak at all. CID 1355640; bugfix on no released Tor.
This commit is contained in:
parent
580e549f75
commit
a17537a238
@ -2157,6 +2157,7 @@ check_private_dir(const char *dirname, cpd_check_t check,
|
|||||||
if (pw == NULL) {
|
if (pw == NULL) {
|
||||||
log_warn(LD_CONFIG, "Error setting configured user: %s not found",
|
log_warn(LD_CONFIG, "Error setting configured user: %s not found",
|
||||||
effective_user);
|
effective_user);
|
||||||
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
running_uid = pw->pw_uid;
|
running_uid = pw->pw_uid;
|
||||||
|
Loading…
Reference in New Issue
Block a user