I have not reproduced the access-after-free described in https://fedorahosted.org/sssd/ticket/1706 but the backtrace matches the fix and I think it's simply the correct thing to do.
>From d4f0270452697e805bd2077e91f4b1aa1636d0f2 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek <[email protected]> Date: Sun, 16 Dec 2012 23:31:09 +0100 Subject: [PATCH] RESOLV: Do not steal the resulting hostent on error
https://fedorahosted.org/sssd/ticket/1706 --- src/resolv/async_resolv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c index 00aed1434d2cbaf3e43d8cf54742180ab1a3f9fd..268d266a43fec8bfb20ddb09aa75a893c8b9de9c 100644 --- a/src/resolv/async_resolv.c +++ b/src/resolv/async_resolv.c @@ -1080,12 +1080,13 @@ resolv_gethostbyname_dns_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, if (timeouts) { *timeouts = state->timeouts; } + + TEVENT_REQ_RETURN_ON_ERROR(req); + if (rhostent) { *rhostent = talloc_steal(mem_ctx, state->rhostent); } - TEVENT_REQ_RETURN_ON_ERROR(req); - return EOK; } -- 1.8.0.2
_______________________________________________ sssd-devel mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
