diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-09-24 02:42:39 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-09-24 02:42:39 +0000 |
commit | 577757a0c575257cbe741ef172c8e1b7cc425476 (patch) | |
tree | 0813c63cf77976ac3630d45bd44382fcb189d64a /usr.sbin/mtree/spec.c | |
parent | d7c3b0b972ac2bfe24f8457725222addd05351aa (diff) |
The return value of setmode(3) is a pointer to malloc()'ed area and
must be freed to avoid memory leaks if called repeatedly.
From itohy@netbsd.org
Diffstat (limited to 'usr.sbin/mtree/spec.c')
-rw-r--r-- | usr.sbin/mtree/spec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c index d5e3655c5f5..83631ec3e03 100644 --- a/usr.sbin/mtree/spec.c +++ b/usr.sbin/mtree/spec.c @@ -1,5 +1,5 @@ /* $NetBSD: spec.c,v 1.6 1995/03/07 21:12:12 cgd Exp $ */ -/* $OpenBSD: spec.c,v 1.9 1997/07/18 05:49:04 millert Exp $ */ +/* $OpenBSD: spec.c,v 1.10 1998/09/24 02:42:38 millert Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: spec.c,v 1.9 1997/07/18 05:49:04 millert Exp $"; +static char rcsid[] = "$OpenBSD: spec.c,v 1.10 1998/09/24 02:42:38 millert Exp $"; #endif #endif /* not lint */ @@ -210,6 +210,7 @@ set(t, ip) if ((m = setmode(val)) == NULL) error("invalid file mode %s", val); ip->st_mode = getmode(m, 0); + free(m); break; case F_NLINK: ip->st_nlink = strtoul(val, &ep, 10); |