mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 08:09:08 +00:00
Deobfuscate cleanup path in clnt_bck_create(..)
Similar to r300836, cl and ct 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 ct was not, ct would not be free'd, and also removes a duplicate test for cl not being NULL. Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6801 MFC after: 1 week Reported by: Coverity CID: 1229999 Reviewed by: cem Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
340acf4d09
commit
ea85a1540a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=301800
@ -175,14 +175,9 @@ clnt_bck_create(
|
||||
return (cl);
|
||||
|
||||
err:
|
||||
if (cl) {
|
||||
if (ct) {
|
||||
mtx_destroy(&ct->ct_lock);
|
||||
mem_free(ct, sizeof (struct ct_data));
|
||||
}
|
||||
if (cl)
|
||||
mem_free(cl, sizeof (CLIENT));
|
||||
}
|
||||
mtx_destroy(&ct->ct_lock);
|
||||
mem_free(ct, sizeof (struct ct_data));
|
||||
mem_free(cl, sizeof (CLIENT));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user