From cbf01f5113f8899b00e0c204c85e2480d75ffbc2 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Thu, 26 Mar 2009 21:43:18 -0400 Subject: [PATCH] Don't dup() the assuan ctx FD. --- src/libpwmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libpwmd.c b/src/libpwmd.c index cf120806..cab680a4 100644 --- a/src/libpwmd.c +++ b/src/libpwmd.c @@ -182,7 +182,7 @@ static gpg_error_t _socket_connect_finalize(pwm_t *pwm) int active[2]; int n = assuan_get_active_fds(pwm->ctx, 0, active, N_ARRAY(active)); - pwm->fd = n <= 0 ? -1 : dup(active[0]); + pwm->fd = active[0]; #ifdef WITH_PINENTRY pwm->pid = -1; pwm->pinentry_tries = 3; @@ -315,6 +315,7 @@ static void _ssh_assuan_deinit(assuan_context_t ctx) { pwm_t *pwm = assuan_get_pointer(ctx); + pwm->tcp_conn->fd = -1; _ssh_deinit(pwm->tcp_conn); pwm->tcp_conn = NULL; } -- 2.11.4.GIT