diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-11-28 08:52:48 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-11-28 08:52:48 -0500 | 
| commit | 74f3656d12b5a99160aeabea2784514bf22548fa (patch) | |
| tree | 004adda1f1adcdddbfb5a0b65acb1054d63aba0e | |
| parent | 89eb8c8e4d603860b7b2a475b806b6f0c53ac658 (diff) | |
bgpd: Null checking is not needed on failure
Memory allocations that fail crash the program.  Checking
for NULL is not going to do anything.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| -rw-r--r-- | bgpd/bgp_mpath.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c index 64af8a5411..52f6b64c2c 100644 --- a/bgpd/bgp_mpath.c +++ b/bgpd/bgp_mpath.c @@ -278,8 +278,10 @@ void bgp_mp_list_add(struct list *mp_list, struct bgp_path_info *mpinfo)  static struct bgp_path_info_mpath *bgp_path_info_mpath_new(void)  {  	struct bgp_path_info_mpath *new_mpath; +  	new_mpath = XCALLOC(MTYPE_BGP_MPATH_INFO,  			    sizeof(struct bgp_path_info_mpath)); +  	return new_mpath;  } @@ -313,8 +315,6 @@ bgp_path_info_mpath_get(struct bgp_path_info *path)  	if (!path->mpath) {  		mpath = bgp_path_info_mpath_new(); -		if (!mpath) -			return NULL;  		path->mpath = mpath;  		mpath->mp_info = path;  	}  | 
