svn rev #25521: branches/krb5-1-10/src/lib/krb5/os/

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


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

pull up r25498 from trunk

 ------------------------------------------------------------------------
 r25498 | hartmans | 2011-12-02 13:52:22 -0500 (Fri, 02 Dec 2011) | 8 lines

 ticket: 7036
 subject: Fix free ofuninitialized memory in sname_to_princ
 tags: pullup
 Target_Version: 1.10

 Fix free of uninitialized memory in error case introduced in 1.10
 development cycle.


Changed Files:
U   branches/krb5-1-10/src/lib/krb5/os/sn2princ.c
Modified: branches/krb5-1-10/src/lib/krb5/os/sn2princ.c
===================================================================
--- branches/krb5-1-10/src/lib/krb5/os/sn2princ.c	2011-12-05 23:43:23 UTC (rev 25520)
+++ branches/krb5-1-10/src/lib/krb5/os/sn2princ.c	2011-12-05 23:43:25 UTC (rev 25521)
@@ -90,7 +90,7 @@
         /* copy the hostname into non-volatile storage */
 
         if (type == KRB5_NT_SRV_HST) {
-            struct addrinfo *ai, hints;
+            struct addrinfo *ai = NULL, hints;
             int err;
             char hnamebuf[NI_MAXHOST];
 
@@ -114,7 +114,8 @@
             }
             remote_host = strdup((ai && ai->ai_canonname) ? ai->ai_canonname : hostname);
             if (!remote_host) {
-                freeaddrinfo(ai);
+                if(ai)
+                    freeaddrinfo(ai);
                 return ENOMEM;
             }
 




More information about the cvs-krb5 mailing list