[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240318091640.2672-1-dkirjanov@suse.de>
Date: Mon, 18 Mar 2024 05:16:40 -0400
From: Denis Kirjanov <kirjanov@...il.com>
To: stephen@...workplumber.org,
dsahern@...nel.org
Cc: netdev@...r.kernel.org,
Denis Kirjanov <dkirjanov@...e.de>
Subject: [PATCH iproute2] 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 <dkirjanov@...e.de>
---
misc/ifstat.c | 1 -
1 file changed, 1 deletion(-)
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;
}
--
2.30.2
Powered by blists - more mailing lists