ifstat: don't set errno if strdup fails
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- misc/ifstat.c | 1 - 1 file changed, 1 deletion(-)
misc/ifstat.c +0 -1
@@ -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 ; }
Signature · 1 line
2.30.2
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Quoted 7 lines · On Mon, 18 Mar 2024 05:16:40 -0400 you wrote:
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 <[email protected]>--- misc/ifstat.c | 1 - 1 file changed, 1 deletion(-)
Here is the summary with links:
- [iproute2] ifstat: don't set errno if strdup fails
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=4da7bfbf917b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html