We don't even NULL the pointer out, so we're freeing the same
object twice here.

Coverity #951

Signed-off-by: Dave Jones <[EMAIL PROTECTED]>

--- linux-2.6/net/sunrpc/auth_gss/gss_krb5_wrap.c~      2006-03-06 
04:18:50.000000000 -0500
+++ linux-2.6/net/sunrpc/auth_gss/gss_krb5_wrap.c       2006-03-06 
04:19:40.000000000 -0500
@@ -205,8 +205,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, i
                BUG();
        }
 
-       kfree(md5cksum.data);
-
        /* XXX would probably be more efficient to compute checksum
         * and encrypt at the same time: */
        if ((krb5_make_seq_num(kctx->seq, kctx->initiate ? 0 : 0xff,
@@ -221,7 +219,8 @@ gss_wrap_kerberos(struct gss_ctx *ctx, i
 
        return ((kctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE);
 out_err:
-       if (md5cksum.data) kfree(md5cksum.data);
+       if (md5cksum.data)
+               kfree(md5cksum.data);
        return GSS_S_FAILURE;
 }
 

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to