On Mon, Sep 08, 2014 at 05:09:11PM -0400, Simo Sorce wrote:
On Mon, 2014-09-08 at 20:36 +0200, Lukas Slebodnik wrote:
> On (08/09/14 20:31), Jakub Hrozek wrote:
> >Reported by Coverity.
>
> >From e2b5f6e519a9c5ea4c6bb669ac75c712fa42fa40 Mon Sep 17 00:00:00 2001
> >From: Jakub Hrozek <jhrozek(a)redhat.com>
> >Date: Mon, 8 Sep 2014 20:30:25 +0200
> >Subject: [PATCH] LDAP: Check return value
> >
> >Reported by Coverity
> >---
> > src/providers/ldap/sdap_access.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> >diff --git a/src/providers/ldap/sdap_access.c
b/src/providers/ldap/sdap_access.c
> >index
3b2d3970cdc2efa395dfe99f1647d044d2f7393d..dda60fc2886171671f2ce7b511693ab920faa1ec 100644
> >--- a/src/providers/ldap/sdap_access.c
> >+++ b/src/providers/ldap/sdap_access.c
> >@@ -1461,6 +1461,12 @@ static void sdap_access_lock_get_lockout_done(struct
tevent_req *subreq)
> > state = tevent_req_data(req, struct sdap_access_lock_req_ctx);
> >
> > ret = sdap_get_generic_recv(subreq, state, &num_results,
&results);
> >+ if (ret != EOK) {
> >+ DEBUG(SSSDBG_OP_FAILURE, "Cannot retrieve ppolicy\n");
> >+ ret = ERR_NETWORK_IO;
> >+ goto done;
> >+ }
> >+
> > talloc_zfree(subreq);
> ACK
Not a big deal but we used to talloc_zfree() as the first thing, before
checking (and eventually failing) the return error.
Simo.
Thank you. I think in the pre-release frenzy we didn't follow the best
practices. A patch for master is attached.