diff options
author | sangeeta <none@none> | 2007-09-19 09:49:50 -0700 |
---|---|---|
committer | sangeeta <none@none> | 2007-09-19 09:49:50 -0700 |
commit | 29bc4795a563df76952f94da2aa3b7daa8abf972 (patch) | |
tree | ab71700e33ca764ee6b0334eef5a3ae31ae55b00 /usr/src | |
parent | f8825440532850af4790bbc685223958d4042844 (diff) | |
download | illumos-joyent-29bc4795a563df76952f94da2aa3b7daa8abf972.tar.gz |
6576808 R_malloc can fail and the result is not checked, possibly panicking
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/inet/ip/ip_ftable.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/src/uts/common/inet/ip/ip_ftable.c b/usr/src/uts/common/inet/ip/ip_ftable.c index 4ae1cbd1dc..92a17dcd84 100644 --- a/usr/src/uts/common/inet/ip/ip_ftable.c +++ b/usr/src/uts/common/inet/ip/ip_ftable.c @@ -916,7 +916,8 @@ create_irecache: /* Obtain dst_ill */ dst_ill = ip_newroute_get_dst_ill(ire->ire_ipif->ipif_ill); if (dst_ill == NULL) { - ip2dbg(("ire_forward no dst ill; ire 0x%p\n", (void *)ire)); + ip2dbg(("ire_forward no dst ill; ire 0x%p\n", + (void *)ire)); goto icmp_err_ret; } @@ -1110,6 +1111,10 @@ ire_get_bucket(ire_t *ire) * add the route. based on BSD's rtrequest1(RTM_ADD) */ R_Malloc(rt, rt_entry_cache, sizeof (*rt)); + /* kmem_alloc failed */ + if (rt == NULL) + return (NULL); + (void) memset(rt, 0, sizeof (*rt)); rt->rt_nodes->rn_key = (char *)&rt->rt_dst; rt->rt_dst = rdst; |