[5] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Memory leak in klist

daemon@ATHENA.MIT.EDU (Barr3y Jaspan)
Sat Jun 30 14:40:04 1990

Date: Sat, 30 Jun 90 14:39:53 -0400
From: "Barr3y Jaspan" <bjaspan@ATHENA.MIT.EDU>
To: krb5-bugs@ATHENA.MIT.EDU


This patch fixes a memory leak and and unviolates an abstraction in
klist.c.

*** klist.c	Tue May 29 15:00:50 1990
--- /tmp/klist.c	Sat Jun 30 14:37:05 1990
***************
*** 105,111 ****
  	exit(1);
      }
      printf("Ticket cache: %s\nDefault principal: %s\n",
! 	   (*cache->ops->get_name)(cache), name);
      free(name);
      if (code = krb5_cc_start_seq_get(cache, &cur)) {
  	com_err(argv[0], code, "while starting to retrieve tickets");
--- 105,111 ----
  	exit(1);
      }
      printf("Ticket cache: %s\nDefault principal: %s\n",
! 	   krb5_cc_get_name(cache), name);
      free(name);
      if (code = krb5_cc_start_seq_get(cache, &cur)) {
  	com_err(argv[0], code, "while starting to retrieve tickets");
***************
*** 124,129 ****
--- 124,131 ----
  	    continue;
  	}
  	printf("C: %s\tS:%s\n", name, sname);
+ 	free(name);
+ 	free(sname);
      }
      if (code == KRB5_CC_END) {
  	if (code = krb5_cc_end_seq_get(cache, &cur)) {

home help back first fref pref prev next nref lref last post