Skip to contentSkip to conversation

ifstat: don't set errno if strdup fails

PATCH Applied Denis Kirjanov 2 participants 2 messages Mar 18, 2024 – Mar 20, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 misc/ifstat.c | 1 -
 1 file changed, 1 deletion(-)
misc/ifstat.c +0 -1
index 352e5622..9b93ded3 100644
@@ -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
#1 lore raw
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.

---
 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