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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to