memory leak in ccbase.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

memory leak in ccbase.c

JC Ferguson
Hi,

Has the memory leak in ccbase.c been fixed in later revisions of the
kerberos library?  Looks like a potential mis-merge? The first 4 lines
of code are repeated in the "else" clause.  I am using 1.3.4.

 == start code snippet ==

    resid = name + pfxlen + 1;
       
    pfx = malloc (pfxlen+1);
    if (!pfx)
        return ENOMEM;

    if ( pfxlen == 1 && isalpha(name[0]) ) {
        /* We found a drive letter not a prefix - use FILE: */
        pfx = strdup("FILE:");
        if (!pfx)
            return ENOMEM;

        resid = name;
    } else {
        resid = name + pfxlen + 1;

        pfx = malloc (pfxlen+1);
        if (!pfx)
            return ENOMEM;
        memcpy (pfx, name, pfxlen);
        pfx[pfxlen] = '\0';
    }

 == end code snippet ==

thanks,
jc

_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev