summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtsold/if.c
diff options
context:
space:
mode:
authorsuz <suz@FreeBSD.org>2006-03-24 23:59:51 +0000
committersuz <suz@FreeBSD.org>2006-03-24 23:59:51 +0000
commit2c8d49d5d1a8385d19090b2ac127b5099ac87ca5 (patch)
tree04fd1af48e4e980f0ccade1314b827eb4cb36094 /usr.sbin/rtsold/if.c
parentca5f33b3f61f30fed252c4c0e410117964de79d3 (diff)
downloadFreeBSD-src-2c8d49d5d1a8385d19090b2ac127b5099ac87ca5.zip
FreeBSD-src-2c8d49d5d1a8385d19090b2ac127b5099ac87ca5.tar.gz
fixed a potential memory leak
Obtained from: KAME MFC after: 1 day
Diffstat (limited to 'usr.sbin/rtsold/if.c')
-rw-r--r--usr.sbin/rtsold/if.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
index 23e4e6f..eb28805 100644
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -277,8 +277,10 @@ if_nametosdl(char *name)
return(NULL);
}
- if ((ret_sdl = malloc(sdl->sdl_len)) == NULL)
+ if ((ret_sdl = malloc(sdl->sdl_len)) == NULL) {
+ free(buf);
return(NULL);
+ }
memcpy((caddr_t)ret_sdl, (caddr_t)sdl, sdl->sdl_len);
free(buf);
OpenPOWER on IntegriCloud