Properly release resources in krb5_copy_authenticator()
authorZhanna Tsitkov <tsitkova@mit.edu>
Thu, 28 Apr 2011 15:43:45 +0000 (15:43 +0000)
committerZhanna Tsitkov <tsitkova@mit.edu>
Thu, 28 Apr 2011 15:43:45 +0000 (15:43 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24904 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/copy_athctr.c

index 81473d08eb65b7dfa1fa3988f1ad2f61bda92bea..9cc7b4c666cc441ae1c23d4813ac81f73b260796 100644 (file)
@@ -55,7 +55,6 @@ krb5_copy_authenticator(krb5_context context, const krb5_authenticator *authfrom
     if (authfrom->subkey) {
         retval = krb5_copy_keyblock(context, authfrom->subkey, &tempto->subkey);
         if (retval) {
-            free(tempto->subkey);
             krb5_free_checksum(context, tempto->checksum);
             krb5_free_principal(context, tempto->client);
             free(tempto);
@@ -67,10 +66,9 @@ krb5_copy_authenticator(krb5_context context, const krb5_authenticator *authfrom
         retval = krb5_copy_authdata(context, authfrom->authorization_data,
                                     &tempto->authorization_data);
         if (retval) {
-            free(tempto->subkey);
+            krb5_free_keyblock(context, tempto->subkey);
             krb5_free_checksum(context, tempto->checksum);
             krb5_free_principal(context, tempto->client);
-            krb5_free_authdata(context, tempto->authorization_data);
             free(tempto);
             return retval;
         }