Check whether profile is valid before partying on it
authorDanilo Almeida <dalmeida@mit.edu>
Wed, 23 Jun 1999 22:18:05 +0000 (22:18 +0000)
committerDanilo Almeida <dalmeida@mit.edu>
Wed, 23 Jun 1999 22:18:05 +0000 (22:18 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11527 dc483132-0cff-0310-8789-dd5450dbe970

src/util/profile/ChangeLog
src/util/profile/prof_init.c

index 1d5748853ab3ffc9e96a033f8c62abb5ad24e071..719243cd40c7600e6b15149ab39ed37d4903953c 100644 (file)
@@ -1,3 +1,8 @@
+1999-06-23  Danilo Almeida  <dalmeida@mit.edu>
+
+       * prof_init.c (profile_abandon, profile_release): Check whether
+               profile is valid before partying on it.
+
 1999-06-18  Ken Raeburn  <raeburn@mit.edu>
 
        * prof_tree.c (profile_node_iterator): Remove semicolon after
index ab38a6d2e72d559e082b866d5b8a837054689739..e525a37ebc1e4a0521f505056aa73a772c4f2fb0 100644 (file)
@@ -139,6 +139,9 @@ profile_abandon(profile)
 {
        prf_file_t      p, next;
 
+       if (!profile || profile->magic != PROF_MAGIC_PROFILE)
+               return;
+
        for (p = profile->first_file; p; p = next) {
                next = p->next;
                profile_free_file(p);
@@ -153,6 +156,9 @@ profile_release(profile)
 {
        prf_file_t      p, next;
 
+       if (!profile || profile->magic != PROF_MAGIC_PROFILE)
+               return;
+
        for (p = profile->first_file; p; p = next) {
                next = p->next;
                profile_close_file(p);