Hi All,

While using clang static analyzer at CURRENT (r261322) I got:

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
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to