krb5_locate_kdc() in source/libsmb/clikrb5.c

Albert Chin samba-technical at mlists.thewrittenword.com
Mon Dec 20 20:35:17 GMT 2004


Function krb5_locate_kdc() in source/libsmb/clikrb5.c (SAMBA_3_0
branch) has the following:
#if !defined(HAVE_KRB5_LOCATE_KDC)
 krb5_error_code krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters)
{
        ...
        *addr_pp = NULL;
        ...
        *addr_pp = SMB_MALLOC(sizeof(struct sockaddr) * num_kdcs);
        memset(*addr_pp, '\0', sizeof(struct sockaddr) * num_kdcs );
        ...
        *naddrs = num_kdcs;
        *addr_pp = sa;
        return 0;
}
#endif

What's the point of malloc()'ing memory for *addr_pp when it's never
used? Maybe you mean to memset (*sa, ...)?

-- 
albert chin (china at thewrittenword.com)


More information about the samba-technical mailing list