plug memory leaks
authorJohn Kohl <jtkohl@mit.edu>
Thu, 21 Feb 1991 15:36:52 +0000 (15:36 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 21 Feb 1991 15:36:52 +0000 (15:36 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1757 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/verify_mky.c

index 616b740a82b082b3017b7d7fd88cf120a9de1b18..dd26b96c5517052bb660711b5ea7bb1d8091365b 100644 (file)
@@ -54,10 +54,12 @@ krb5_encrypt_block *eblock;
 
     /* do any necessary key pre-processing */
     if (retval = krb5_process_key(eblock, mkey)) {
+       krb5_db_free_principal(&master_entry, nprinc);
        return(retval);
     }
     if (retval = krb5_kdb_decrypt_key(eblock, &master_entry.key, &tempkey)) {
        (void) krb5_finish_key(eblock);
+       krb5_db_free_principal(&master_entry, nprinc);
        return retval;
     }
     if (memcmp((char *)mkey->contents, (char *)tempkey.contents,
@@ -66,6 +68,8 @@ krb5_encrypt_block *eblock;
        (void) krb5_finish_key(eblock);
     } else
        retval = krb5_finish_key(eblock);
+
+    krb5_db_free_principal(&master_entry, nprinc);
     
     return retval;
 }