svn rev #25519: branches/krb5-1-10/src/lib/krb5/krb/

tlyu@MIT.EDU tlyu at MIT.EDU
Mon Dec 5 18:43:17 EST 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25519
Commit By: tlyu
Log Message:
ticket: 7034
version_fixed: 1.10
status: resolved

pull up r25496 from trunk

 ------------------------------------------------------------------------
 r25496 | hartmans | 2011-12-02 13:52:12 -0500 (Fri, 02 Dec 2011) | 11 lines

 ticket: 7034
 subject: mk_cred: memory management
 target_version: 1.10
 tags: pullup

 Fix for mk_cred.c: calloc() not malloc()

 Avoid calling free() in cleanup on uninitialized sub-ptrs if error occurs.

 Signed-off-by: Kevin Wasserman <kevin.wasserman at painless-security.com>


Changed Files:
U   branches/krb5-1-10/src/lib/krb5/krb/mk_cred.c
Modified: branches/krb5-1-10/src/lib/krb5/krb/mk_cred.c
===================================================================
--- branches/krb5-1-10/src/lib/krb5/krb/mk_cred.c	2011-12-05 23:43:14 UTC (rev 25518)
+++ branches/krb5-1-10/src/lib/krb5/krb/mk_cred.c	2011-12-05 23:43:17 UTC (rev 25519)
@@ -97,7 +97,7 @@
      * structure and copy the ticket into the ticket list.
      */
     for (i = 0; i < nppcreds; i++) {
-        credenc.ticket_info[i] = malloc(sizeof(krb5_cred_info));
+        credenc.ticket_info[i] = calloc(1, sizeof(krb5_cred_info));
         if (credenc.ticket_info[i] == NULL) {
             retval = ENOMEM;
             goto cleanup;




More information about the cvs-krb5 mailing list