Author: ngie
Date: Mon Jul 11 07:24:56 2016
New Revision: 302553
URL: https://svnweb.freebsd.org/changeset/base/302553

Log:
  Don't test for xpt not being NULL before calling svc_xprt_free(..)
  
  svc_xprt_alloc(..) will always return initialized memory as it uses
  mem_alloc(..) under the covers, which uses malloc(.., M_WAITOK, ..).
  
  MFC after: 1 week
  Reported by: Coverity
  CID: 1007341
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/rpc/svc_dg.c

Modified: head/sys/rpc/svc_dg.c
==============================================================================
--- head/sys/rpc/svc_dg.c       Mon Jul 11 07:17:52 2016        (r302552)
+++ head/sys/rpc/svc_dg.c       Mon Jul 11 07:24:56 2016        (r302553)
@@ -142,9 +142,8 @@ svc_dg_create(SVCPOOL *pool, struct sock
        return (xprt);
 freedata:
        (void) printf(svc_dg_str, __no_mem_str);
-       if (xprt) {
-               svc_xprt_free(xprt);
-       }
+       svc_xprt_free(xprt);
+
        return (NULL);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to