diff options
author | brueffer <brueffer@FreeBSD.org> | 2014-05-02 20:45:55 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2014-05-02 20:45:55 +0000 |
commit | c006433c40c6a68da01db7ddd1402578183ff59c (patch) | |
tree | f6dfe0e7883d9e4e4ff2e54f763d68f77eff1a68 /sys/rpc | |
parent | ca19420e0898e300e1d8a509ebfe8bf1c0fcc1a6 (diff) | |
download | FreeBSD-src-c006433c40c6a68da01db7ddd1402578183ff59c.zip FreeBSD-src-c006433c40c6a68da01db7ddd1402578183ff59c.tar.gz |
Properly free resources in case of error.
CID: 1007032
Found with: Coverity Prevent(tm)
MFC after: 2 weeks
Diffstat (limited to 'sys/rpc')
-rw-r--r-- | sys/rpc/clnt_vc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 44d1097..67ad58f 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -270,14 +270,12 @@ clnt_vc_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)); + if (ct) { + mtx_destroy(&ct->ct_lock); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } |