Hi All,

While using clang static analyzer at CURRENT (r261322) I got:
http://gw.wart.ru/2014-02-01-200848-39517-1/report-01bc48.html

There is no need at line 143 to "goto cleanup_svc_vc_create" (neither
xprt nor r are allocated so far). Just "return NULL" should be fine.
BTW, NetBSD do the latter as well.

So I propose a tiny patch (attached).

-- 
WBR, Boris Samorodov (bsam)
FreeBSD Committer, http://www.FreeBSD.org The Power To Serve

Index: /usr/src/lib/libc/rpc/svc_vc.c
===================================================================
--- /usr/src/lib/libc/rpc/svc_vc.c      (revision 260036)
+++ /usr/src/lib/libc/rpc/svc_vc.c      (working copy)
@@ -141,7 +141,7 @@
        r = mem_alloc(sizeof(*r));
        if (r == NULL) {
                warnx("svc_vc_create: out of memory");
-               goto cleanup_svc_vc_create;
+               return NULL;
        }
        r->sendsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsize);
        r->recvsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsize);
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to