* [PATCH iproute2] rt_names: check for malloc() failure
@ 2023-06-08 1:34 Stephen Hemminger
2023-06-08 1:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2023-06-08 1:34 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger
Fixes issue reported by Gcc 13 analayzer.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/rt_names.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/rt_names.c b/lib/rt_names.c
index b441e98f8078..68db74e301ff 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -81,6 +81,10 @@ rtnl_hash_initialize(const char *file, struct rtnl_hash_entry **hash, int size)
continue;
entry = malloc(sizeof(*entry));
+ if (entry == NULL) {
+ fprintf(stderr, "malloc error: for entry\n");
+ break;
+ }
entry->id = id;
entry->name = strdup(namebuf);
entry->next = hash[id & (size - 1)];
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] rt_names: check for malloc() failure
2023-06-08 1:34 [PATCH iproute2] rt_names: check for malloc() failure Stephen Hemminger
@ 2023-06-08 1:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-06-08 1:40 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
Hello:
This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:
On Wed, 7 Jun 2023 18:34:54 -0700 you wrote:
> Fixes issue reported by Gcc 13 analayzer.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> lib/rt_names.c | 4 ++++
> 1 file changed, 4 insertions(+)
Here is the summary with links:
- [iproute2] rt_names: check for malloc() failure
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=507fe042181c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-08 1:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08 1:34 [PATCH iproute2] rt_names: check for malloc() failure Stephen Hemminger
2023-06-08 1:40 ` 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).