* heuristic.c (get_authorized_princ_names): Fix to not call
authorTom Yu <tlyu@mit.edu>
Thu, 4 Mar 1999 23:48:15 +0000 (23:48 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 4 Mar 1999 23:48:15 +0000 (23:48 +0000)
list_union() if cmd is NULL, otherwise freed memory gets
referenced.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11239 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/ksu/ChangeLog
src/clients/ksu/heuristic.c

index a18067bb6e1093fe97ddeaed82b0c8d2aea92fe7..674b3cec324121168a5b84073ac9447b4351851e 100644 (file)
@@ -1,3 +1,9 @@
+Thu Mar  4 18:46:55 1999  Tom Yu  <tlyu@mit.edu>
+
+       * heuristic.c (get_authorized_princ_names): Fix to not call
+       list_union() if cmd is NULL, otherwise freed memory gets
+       referenced.
+
 Thu Feb 18 22:26:30 1999  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in (ksu): Add $(KSU_LIBS) in case we need -lsecurity.
index e0ee71d5d63a10aece8773c19bc5f96e525b3599..40858fb3ad684193f56227aefdd233b6303a9141 100644 (file)
@@ -253,17 +253,19 @@ get_authorized_princ_names(luser, cmd, princ_list)
        }
     }  
 
-    if(retval = list_union(k5login_list, k5users_filt_list, &combined_list)){
-       close_time(k5users_flag,users_fp, k5login_flag,login_fp);
-       return retval;
-    }
-
     close_time(k5users_flag,users_fp, k5login_flag, login_fp);
 
     if (cmd) {
+       if (retval = list_union(k5login_list,
+                              k5users_filt_list, &combined_list)){
+           close_time(k5users_flag,users_fp, k5login_flag,login_fp);
+           return retval;
+       }
        *princ_list = combined_list;
        return 0;
     } else {
+       if (k5users_filt_list != NULL)
+           free(k5users_filt_list);
        *princ_list = k5login_list;
        return 0;
     }