* kdb5_mkdums.c (main): Fix memory leak of master principal at exit
authorEzra Peisach <epeisach@mit.edu>
Mon, 24 May 2004 19:33:33 +0000 (19:33 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 24 May 2004 19:33:33 +0000 (19:33 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16352 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/create/ChangeLog
src/tests/create/kdb5_mkdums.c

index 001b6b1f402661bbea8da3c75bd0d8096519614b..8d2b01aa6aebda74dbc53c628560e3a6ccdabf50 100644 (file)
@@ -1,3 +1,7 @@
+2004-05-24  Ezra Peisach  <epeisach@mit.edu>
+
+       * kdb5_mkdums.c (main): Fix memory leak of master principal at exit. 
+
 2003-05-22  Ezra Peisach  <epeisach@mit.edu>
 
        * kdb5_mkdums.c (main): When attempting to register writable
index 4a1f0e94f958171693a20388af7df718a26485ca..024664c8032d4a02875419438b57fadba83d3d4d 100644 (file)
@@ -65,6 +65,7 @@ int status;
     exit(status);
 }
 
+int master_princ_set = 0;
 krb5_keyblock master_keyblock;
 krb5_principal master_princ;
 krb5_db_entry master_entry;
@@ -205,6 +206,9 @@ main(argc, argv)
        com_err(progname, retval, "while closing database");
        exit(1);
     }
+    if (master_princ_set) {
+       krb5_free_principal(test_context, master_princ);
+    }
     krb5_free_context(test_context);
     exit(0);
 }
@@ -345,6 +349,7 @@ char *dbname;
        com_err(pname, retval, "while setting up master key name");
        return(1);
     }
+    master_princ_set = 1;
     if (mkey_password) {
        pwd.data = mkey_password;
        pwd.length = strlen(mkey_password);