krb5_wrap: Remove unneded smb_krb5_free_error()
authorAndreas Schneider <asn@samba.org>
Mon, 29 Aug 2016 07:09:18 +0000 (09:09 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 31 Aug 2016 18:59:14 +0000 (20:59 +0200)
krb5_free_error() is availalbe in MIT and Heimdal. Both implementations
free the contents and the pointer. krb5_free_data_contents() is Heimdal
only. Which function you need to call depends.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/krb5_wrap/krb5_samba.c
lib/krb5_wrap/krb5_samba.h
source4/torture/rpc/lsa.c

index dde85f9..8e1c7d0 100644 (file)
@@ -896,15 +896,6 @@ krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr
        return ret;
 }
 
- void smb_krb5_free_error(krb5_context context, krb5_error *krberror)
-{
-#ifdef HAVE_KRB5_FREE_ERROR_CONTENTS /* Heimdal */
-       krb5_free_error_contents(context, krberror);
-#else /* MIT */
-       krb5_free_error(context, krberror);
-#endif
-}
-
  krb5_error_code handle_krberror_packet(krb5_context context,
                                        krb5_data *packet)
 {
@@ -928,7 +919,7 @@ krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr
                        got_error_code = true;
                }
 
-               smb_krb5_free_error(context, &krberror);
+               krb5_free_error(context, &krberror);
        }
 #else /* MIT */
        {
@@ -948,7 +939,7 @@ krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr
 #endif
                        got_error_code = true;
                }
-               smb_krb5_free_error(context, krberror);
+               krb5_free_error(context, krberror);
        }
 #endif
        if (got_error_code) {
index e69b53d..687a9f1 100644 (file)
@@ -196,7 +196,7 @@ krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr
 krb5_error_code smb_krb5_free_addresses(krb5_context context, smb_krb5_addresses *addr);
 NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error);
 krb5_error_code nt_status_to_krb5(NTSTATUS nt_status);
-void smb_krb5_free_error(krb5_context context, krb5_error *krberror);
+
 krb5_error_code handle_krberror_packet(krb5_context context,
                                          krb5_data *packet);
 
index fa884fb..deb4b2a 100644 (file)
@@ -2977,8 +2977,8 @@ static krb5_error_code check_pw_with_krb5_send_and_recv_func(krb5_context contex
 
        hi.proto = KRB5_KRBHST_TCP;
 
-       smb_krb5_free_error(ctx->smb_krb5_context->krb5_context,
-                           &ctx->error);
+       krb5_free_error_contents(ctx->smb_krb5_context->krb5_context,
+                                &ctx->error);
        ctx->counts.io++;
 
        k5ret = smb_krb5_send_and_recv_func_forced(context, ctx->server,
@@ -3158,8 +3158,8 @@ static int check_pw_with_krb5_ctx_destructor(struct check_pw_with_krb5_ctx *ctx)
 
        free_EncTicketPart(&ctx->krbtgt_referral_enc_part);
 
-       smb_krb5_free_error(ctx->smb_krb5_context->krb5_context,
-                           &ctx->error);
+       krb5_free_error_contents(ctx->smb_krb5_context->krb5_context,
+                                &ctx->error);
 
        talloc_unlink(ctx, ctx->smb_krb5_context);
        ctx->smb_krb5_context = NULL;