From be95b52c2d0c21b1fe92f9f90166fc2fa8eecc95 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 4 Mar 1999 23:48:15 +0000 Subject: [PATCH] * heuristic.c (get_authorized_princ_names): Fix to not call 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 | 6 ++++++ src/clients/ksu/heuristic.c | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/clients/ksu/ChangeLog b/src/clients/ksu/ChangeLog index a18067bb6..674b3cec3 100644 --- a/src/clients/ksu/ChangeLog +++ b/src/clients/ksu/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 4 18:46:55 1999 Tom Yu + + * 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 * Makefile.in (ksu): Add $(KSU_LIBS) in case we need -lsecurity. diff --git a/src/clients/ksu/heuristic.c b/src/clients/ksu/heuristic.c index e0ee71d5d..40858fb3a 100644 --- a/src/clients/ksu/heuristic.c +++ b/src/clients/ksu/heuristic.c @@ -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; } -- 2.26.2