Deobfuscate cleanup path in clnt_dg_create(..)
Similar to r300836 and r301800, cl and cu will always be non-NULL as they're allocated using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`. Deobfuscating the cleanup path fixes a leak where if cl was NULL and cu was not, cu would not be free'd, and also removes a duplicate test for cl not being NULL. MFC after: 1 week Reported by: Coverity CID: 1007033, 1007344 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
47a3ee5c60
commit
f99529597c
@ -313,11 +313,9 @@ clnt_dg_create(
|
||||
cl->cl_netid = NULL;
|
||||
return (cl);
|
||||
err2:
|
||||
if (cl) {
|
||||
mem_free(cl, sizeof (CLIENT));
|
||||
if (cu)
|
||||
mem_free(cu, sizeof (*cu));
|
||||
}
|
||||
mem_free(cl, sizeof (CLIENT));
|
||||
mem_free(cu, sizeof (*cu));
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user