[krbdev.mit.edu #6284] memory leaks in error conditions
Love Hornquist Astrand via RT
rt-comment at krbdev.mit.edu
Thu Jan 22 19:21:49 EST 2009
22 jan 2009 kl. 11.10 skrev Greg Hudson via RT:
> First patch looks fine; I adapted it to the current code (which was
> changed fairly heavily by Luke) and will commit shortly.
>
> I don't understand the second patch. The first hunk appears to be for
> Apple-specific code, so I'm ignoring that. The other hunks move a
> free(reply.enc_part.ciphertext.data) into the errorout label. But (a)
> that move seems unnecessary, since in the old location the data was
> freed immediately after it was allocated (i.e. on successful return
> from
> krb5_encode_kdc_rep), and (b) that move seems incorrect, since "goto
> errout" can happen in cases where reply.enc_part.ciphertext.data
> hasn't
> been initialized.
There needs to be an if(reply.enc_part.ciphertext.data) protecting.
The reason we need this is that the pws case add an extra goto errout;
Love
More information about the krb5-bugs
mailing list