svn rev #25498: trunk/src/lib/krb5/os/

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


http://src.mit.edu/fisheye/changelog/krb5/?cs=25498
Commit By: hartmans
Log Message:
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   trunk/src/lib/krb5/os/sn2princ.c
Modified: trunk/src/lib/krb5/os/sn2princ.c
===================================================================
--- trunk/src/lib/krb5/os/sn2princ.c	2011-12-02 18:52:19 UTC (rev 25497)
+++ trunk/src/lib/krb5/os/sn2princ.c	2011-12-02 18:52:22 UTC (rev 25498)
@@ -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