summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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