Fix two more memory leaks found by Hubert Feyrer.

This commit is contained in:
jschauma 2003-08-21 04:30:25 +00:00
parent 42a8e50b21
commit ca5d0a41d2
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: chio.c,v 1.20 2003/08/04 22:31:21 jschauma Exp $ */
/* $NetBSD: chio.c,v 1.21 2003/08/21 04:30:25 jschauma Exp $ */
/*-
* Copyright (c) 1996, 1998, 1999 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
__COPYRIGHT(
"@(#) Copyright (c) 1996, 1998, 1999\
The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: chio.c,v 1.20 2003/08/04 22:31:21 jschauma Exp $");
__RCSID("$NetBSD: chio.c,v 1.21 2003/08/21 04:30:25 jschauma Exp $");
#endif
#include <sys/param.h>
@ -710,6 +710,7 @@ do_status(const char *cname, int argc, char **argv)
free(ces);
}
free(cn);
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ln.c,v 1.24 2003/08/13 03:21:08 itojun Exp $ */
/* $NetBSD: ln.c,v 1.25 2003/08/21 04:30:25 jschauma Exp $ */
/*
* Copyright (c) 1987, 1993, 1994
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#else
__RCSID("$NetBSD: ln.c,v 1.24 2003/08/13 03:21:08 itojun Exp $");
__RCSID("$NetBSD: ln.c,v 1.25 2003/08/21 04:30:25 jschauma Exp $");
#endif
#endif /* not lint */
@ -188,6 +188,8 @@ linkit(char *target, char *source, int isdir)
if ((fflag && unlink(source) < 0 && errno != ENOENT) ||
(*linkf)(target, source)) {
warn("%s", source);
free(sn);
free(tn);
return (1);
}
if (vflag)