From: Denis Kirjanov Date: Mon, 18 Mar 2024 09:16:40 +0000 (-0400) Subject: ifstat: don't set errno if strdup fails X-Git-Tag: v6.9.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4da7bfbf917bacfe19974634de0006be24f0b89f;p=thirdparty%2Fiproute2.git ifstat: don't set errno if strdup fails 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 Signed-off-by: Stephen Hemminger --- diff --git a/misc/ifstat.c b/misc/ifstat.c index 352e5622..9b93ded3 100644 --- a/misc/ifstat.c +++ b/misc/ifstat.c @@ -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; }