svn rev #25496: trunk/src/lib/krb5/krb/

hartmans@MIT.EDU hartmans at MIT.EDU
Fri Dec 2 13:52:12 EST 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25496
Commit By: hartmans
Log Message:
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   trunk/src/lib/krb5/krb/mk_cred.c
Modified: trunk/src/lib/krb5/krb/mk_cred.c
===================================================================
--- trunk/src/lib/krb5/krb/mk_cred.c	2011-11-30 22:28:43 UTC (rev 25495)
+++ trunk/src/lib/krb5/krb/mk_cred.c	2011-12-02 18:52:12 UTC (rev 25496)
@@ -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