Don't bomb out if the argument to krb5_free_principal() is NULL
authorTheodore Tso <tytso@mit.edu>
Wed, 5 Oct 1994 02:11:58 +0000 (02:11 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 5 Oct 1994 02:11:58 +0000 (02:11 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4457 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/free/ChangeLog [new file with mode: 0644]
src/lib/krb5/free/f_princ.c

diff --git a/src/lib/krb5/free/ChangeLog b/src/lib/krb5/free/ChangeLog
new file mode 100644 (file)
index 0000000..30964e7
--- /dev/null
@@ -0,0 +1,4 @@
+Tue Oct  4 22:05:04 1994  Theodore Y. Ts'o  (tytso@dcl)
+
+       * f_princ.c (krb5_free_principal): Don't blow up if principal is NULL.
+
index dfb4f23bbad1666e42b689c9f8b58a457ca9d092..b424cdd5d28d5549e11e4531283a3aef8868b93e 100644 (file)
@@ -32,9 +32,13 @@ void
 krb5_free_principal(val)
 krb5_principal val;
 {
-    register int i = krb5_princ_size(val);
+    register int i;
 
+    if (!val)
+       return;
+    
     if (val->data) {
+       i = krb5_princ_size(val);
        while(--i >= 0)
            free(krb5_princ_component(val, i)->data);
        krb5_xfree(val->data);