Properly free resources in case of error.
CID: 1007032 Found with: Coverity Prevent(tm) MFC after: 2 weeks
This commit is contained in:
parent
19e1db1b28
commit
1a2ac459a9
@ -301,15 +301,13 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
|
||||
return (cl);
|
||||
|
||||
err:
|
||||
if (cl) {
|
||||
if (ct) {
|
||||
if (ct->ct_addr.len)
|
||||
mem_free(ct->ct_addr.buf, ct->ct_addr.len);
|
||||
mem_free(ct, sizeof (struct ct_data));
|
||||
}
|
||||
if (cl)
|
||||
mem_free(cl, sizeof (CLIENT));
|
||||
if (ct) {
|
||||
if (ct->ct_addr.len)
|
||||
mem_free(ct->ct_addr.buf, ct->ct_addr.len);
|
||||
mem_free(ct, sizeof (struct ct_data));
|
||||
}
|
||||
if (cl)
|
||||
mem_free(cl, sizeof (CLIENT));
|
||||
return ((CLIENT *)NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user