summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorbrueffer <brueffer@FreeBSD.org>2014-05-02 20:41:09 +0000
committerbrueffer <brueffer@FreeBSD.org>2014-05-02 20:41:09 +0000
commit703d5b18d7a316135660c9947d7f781423aa0687 (patch)
tree4924728833a24ff89f262da69d48a710cb9cb6f7 /lib
parentf82e0f8379713f5d1e2902f9ec3178cbdf8345c6 (diff)
downloadFreeBSD-src-703d5b18d7a316135660c9947d7f781423aa0687.zip
FreeBSD-src-703d5b18d7a316135660c9947d7f781423aa0687.tar.gz
Properly free resources in case of error.
CID: 1007032 Found with: Coverity Prevent(tm) MFC after: 2 weeks
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/clnt_vc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c
index 7cd93b3..117cfba 100644
--- a/lib/libc/rpc/clnt_vc.c
+++ b/lib/libc/rpc/clnt_vc.c
@@ -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);
}
OpenPOWER on IntegriCloud