The run_as structure (handle) is allocated and initialized before
the fork() that spawns the run_as process. Currently, that structure
is only cleaned-up on the parent's end.
This fix performs the clean-up on the worker's side as well.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
ret = -1;
}
worker->sockpair[1] = -1;
+ free(worker->procname);
+ free(worker);
LOG(ret ? PRINT_ERR : PRINT_DBG, "run_as worker exiting (ret = %d)", ret);
exit(ret ? EXIT_FAILURE : EXIT_SUCCESS);
} else {