Skip to content

Commit

Permalink
lib: restrict-access: Free chroot_dir at deinit
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Aug 22, 2018
1 parent d05d508 commit 733c581
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/lib.c
Expand Up @@ -8,6 +8,7 @@
#include "hostpid.h"
#include "ipwd.h"
#include "process-title.h"
#include "restrict-access.h"
#include "var-expand-private.h"
#include "randgen.h"

Expand Down Expand Up @@ -160,6 +161,7 @@ void lib_deinit(void)
var_expand_extensions_deinit();
event_filter_deinit();
lib_event_deinit();
restrict_access_deinit();
i_close_fd(&dev_null_fd);
data_stack_deinit();
env_deinit();
Expand Down
5 changes: 5 additions & 0 deletions src/lib/restrict-access.c
Expand Up @@ -538,3 +538,8 @@ bool restrict_access_have_priv_gid(void)
{
return process_privileged_gid != (gid_t)-1;
}

void restrict_access_deinit(void)
{
i_free(chroot_dir);
}
2 changes: 2 additions & 0 deletions src/lib/restrict-access.h
Expand Up @@ -85,4 +85,6 @@ bool restrict_access_have_priv_gid(void);

gid_t *restrict_get_groups_list(unsigned int *gid_count_r);

void restrict_access_deinit(void);

#endif

0 comments on commit 733c581

Please sign in to comment.