rt_names: check for malloc() failure
Subsystems (3)
PATCH 1/1 rt_names: check for malloc() failure
Fixes issue reported by Gcc 13 analayzer.
Signed-off-by Stephen Hemminger <[email protected]>
--- lib/rt_names.c | 4 ++++ 1 file changed, 4 insertions(+)
lib/rt_names.c +4 -0
@@ -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 )];
Signature · 1 line
2.39.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 6 lines · On Wed, 7 Jun 2023 18:34:54 -0700 you wrote:
Fixes issue reported by Gcc 13 analayzer.
Signed-off-by Stephen Hemminger <[email protected]>--- 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html