krb5_auth_con_free should support freeing a null auth_context without segfault
authorSam Hartman <hartmans@mit.edu>
Mon, 16 Mar 2009 16:49:59 +0000 (16:49 +0000)
committerSam Hartman <hartmans@mit.edu>
Mon, 16 Mar 2009 16:49:59 +0000 (16:49 +0000)
If the input auth_con is NULL, return success.

ticket: 6423

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22092 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/auth_con.c

index ea4ef3a0cf11e95ff496da5578fc3aa67f545933..41a2578e0a8afdb643678d18fadf5f2bde66ee67 100644 (file)
@@ -44,6 +44,8 @@ krb5_auth_con_init(krb5_context context, krb5_auth_context *auth_context)
 krb5_error_code KRB5_CALLCONV
 krb5_auth_con_free(krb5_context context, krb5_auth_context auth_context)
 {
+    if (auth_context == NULL)
+       return 0;
     if (auth_context->local_addr) 
        krb5_free_address(context, auth_context->local_addr);
     if (auth_context->remote_addr)