summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-11-02 20:21:36 +0100
committerJeremy Allison <jra@samba.org>2014-11-03 23:46:05 +0100
commitd428aa65d3e7b78750764e645bc7c1b2eda799ed (patch)
tree2cfeaafd02245d69f504accdc477df009635a970
parent364d55ccabbe319b68b154bd2d15c19b67327ede (diff)
downloadsamba-d428aa65d3e7b78750764e645bc7c1b2eda799ed.tar.gz
samba-d428aa65d3e7b78750764e645bc7c1b2eda799ed.tar.xz
samba-d428aa65d3e7b78750764e645bc7c1b2eda799ed.zip
winbindd: don't leak state_path onto talloc tos
Also check for allocation failures. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/winbindd/winbindd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index caa9ed127d..4978c97aaa 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -1110,6 +1110,7 @@ static bool winbindd_setup_listeners(void)
struct winbindd_listen_state *priv_state = NULL;
struct tevent_fd *fde;
int rc;
+ char *socket_path;
pub_state = talloc(winbind_event_context(),
struct winbindd_listen_state);
@@ -1143,9 +1144,15 @@ static bool winbindd_setup_listeners(void)
goto failed;
}
+ socket_path = get_winbind_priv_pipe_dir();
+ if (socket_path == NULL) {
+ goto failed;
+ }
+
priv_state->privileged = true;
priv_state->fd = create_pipe_sock(
- get_winbind_priv_pipe_dir(), WINBINDD_SOCKET_NAME, 0750);
+ socket_path, WINBINDD_SOCKET_NAME, 0750);
+ TALLOC_FREE(socket_path);
if (priv_state->fd == -1) {
goto failed;
}