From 789872f2e9b512247bdfc3e57e8b6a46541cf5d2 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Mon, 11 Jul 2016 07:24:56 +0000 Subject: [PATCH] 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 --- sys/rpc/svc_dg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/rpc/svc_dg.c b/sys/rpc/svc_dg.c index 1c530bd9ab1..121d151cbce 100644 --- a/sys/rpc/svc_dg.c +++ b/sys/rpc/svc_dg.c @@ -142,9 +142,8 @@ svc_dg_create(SVCPOOL *pool, struct socket *so, size_t sendsize, return (xprt); freedata: (void) printf(svc_dg_str, __no_mem_str); - if (xprt) { - svc_xprt_free(xprt); - } + svc_xprt_free(xprt); + return (NULL); }