svn commit: r265240 - head/sys/rpc
Christian Brueffer
brueffer at FreeBSD.org
Fri May 2 20:45:55 UTC 2014
Author: brueffer
Date: Fri May 2 20:45:55 2014
New Revision: 265240
URL: http://svnweb.freebsd.org/changeset/base/265240
Log:
Properly free resources in case of error.
CID: 1007032
Found with: Coverity Prevent(tm)
MFC after: 2 weeks
Modified:
head/sys/rpc/clnt_vc.c
Modified: head/sys/rpc/clnt_vc.c
==============================================================================
--- head/sys/rpc/clnt_vc.c Fri May 2 20:45:34 2014 (r265239)
+++ head/sys/rpc/clnt_vc.c Fri May 2 20:45:55 2014 (r265240)
@@ -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);
}
More information about the svn-src-head
mailing list