more-memory-leak-fixes-20040418

Another memory leak plugged; thanks to Jeffrey Altman for noticing it.
This commit is contained in:
Nickolai Zeldovich 2004-04-19 06:43:58 +00:00
parent 6f22e163a5
commit daa011af02

View File

@ -190,14 +190,16 @@ rxkad_NewClientSecurityObject(rxkad_level level,
tcp->level = level;
code = fc_keysched(sessionkey, tcp->keysched);
if (code) {
rxi_Free(tsc, size);
rxi_Free(tcp, sizeof(struct rxkad_cprivate));
rxi_Free(tsc, sizeof(struct rx_securityClass));
return 0; /* bad key */
}
memcpy((void *)tcp->ivec, (void *)sessionkey, sizeof(tcp->ivec));
tcp->kvno = kvno; /* key version number */
tcp->ticketLen = ticketLen; /* length of ticket */
if (tcp->ticketLen > MAXKTCTICKETLEN) {
rxi_Free(tsc, size);
rxi_Free(tcp, sizeof(struct rxkad_cprivate));
rxi_Free(tsc, sizeof(struct rx_securityClass));
return 0; /* bad key */
}
memcpy(tcp->ticket, ticket, ticketLen);