]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ifstat: don't set errno if strdup fails
authorDenis Kirjanov <kirjanov@gmail.com>
Mon, 18 Mar 2024 09:16:40 +0000 (05:16 -0400)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 20 Mar 2024 04:17:55 +0000 (21:17 -0700)
the strdup man page states that the errno value
set by the function so there is not need to set it.

Signed-off-by: Denis Kirjanov <dkirjanov@suse.de>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
misc/ifstat.c

index 352e5622c03d0a92921355fd4297336bc244d1ee..9b93ded32a61d3abaeb0e15598fe595564ab8792 100644 (file)
@@ -197,7 +197,6 @@ static int get_nlmsg(struct nlmsghdr *m, void *arg)
        n->name = strdup(RTA_DATA(tb[IFLA_IFNAME]));
        if (!n->name) {
                free(n);
-               errno = ENOMEM;
                return -1;
        }