* [PATCH iproute2] ifstat: don't set errno if strdup fails
@ 2024-03-18 9:16 Denis Kirjanov
2024-03-20 4:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Denis Kirjanov @ 2024-03-18 9:16 UTC (permalink / raw)
To: stephen, dsahern; +Cc: netdev, Denis Kirjanov
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-20 4:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 9:16 [PATCH iproute2] ifstat: don't set errno if strdup fails Denis Kirjanov
2024-03-20 4:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).