summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-09-26 09:04:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-09-26 09:04:44 +0000
commitb1e80105121cbb6a86c0850c2e98f44b1ef5a5a6 (patch)
tree68cb88a7a4c81143cee014e66791fbd861718fb4
parent3ea20cc260f702a5275210fe31883b72721f9888 (diff)
more setmode() leaks -- kill 'em all
-rw-r--r--bin/mkdir/mkdir.c5
-rw-r--r--usr.bin/find/function.c5
-rw-r--r--usr.bin/mkfifo/mkfifo.c14
-rw-r--r--usr.bin/xinstall/xinstall.c5
4 files changed, 18 insertions, 11 deletions
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index 55a63380441..01d0cbc4e31 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkdir.c,v 1.7 1998/01/25 21:54:49 niklas Exp $ */
+/* $OpenBSD: mkdir.c,v 1.8 1998/09/26 09:04:43 deraadt Exp $ */
/* $NetBSD: mkdir.c,v 1.14 1995/06/25 21:59:21 mycroft Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94";
#else
-static char rcsid[] = "$OpenBSD: mkdir.c,v 1.7 1998/01/25 21:54:49 niklas Exp $";
+static char rcsid[] = "$OpenBSD: mkdir.c,v 1.8 1998/09/26 09:04:43 deraadt Exp $";
#endif
#endif /* not lint */
@@ -92,6 +92,7 @@ main(argc, argv)
if ((set = setmode(optarg)) == NULL)
errx(1, "invalid file mode: %s", optarg);
mode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO);
+ free(set);
break;
default:
usage();
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index f1f635c4bee..d7f4c6bf4f3 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: function.c,v 1.11 1997/11/13 08:30:33 deraadt Exp $ */
+/* $OpenBSD: function.c,v 1.12 1998/09/26 09:04:43 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)function.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: function.c,v 1.11 1997/11/13 08:30:33 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: function.c,v 1.12 1998/09/26 09:04:43 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -1035,6 +1035,7 @@ c_perm(perm)
err(1, "-perm: %s: illegal mode string", perm);
new->m_data = getmode(set, 0);
+ free(set);
return (new);
}
diff --git a/usr.bin/mkfifo/mkfifo.c b/usr.bin/mkfifo/mkfifo.c
index 2f6313bcd07..1f48645df49 100644
--- a/usr.bin/mkfifo/mkfifo.c
+++ b/usr.bin/mkfifo/mkfifo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkfifo.c,v 1.4 1996/08/30 07:04:33 etheisen Exp $ */
+/* $OpenBSD: mkfifo.c,v 1.5 1998/09/26 09:04:43 deraadt Exp $ */
/* $NetBSD: mkfifo.c,v 1.7 1994/12/23 07:16:56 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mkfifo.c 8.2 (Berkeley) 1/5/94";
#endif
-static char rcsid[] = "$OpenBSD: mkfifo.c,v 1.4 1996/08/30 07:04:33 etheisen Exp $";
+static char rcsid[] = "$OpenBSD: mkfifo.c,v 1.5 1998/09/26 09:04:43 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -82,10 +82,14 @@ main(argc, argv)
errx(1, "invalid file mode.");
/* NOTREACHED */
}
- /* In symbolic mode strings, the + and - operators are
- interpreted relative to an assumed initial mode of
- a=rw. */
+
+ /*
+ * In symbolic mode strings, the + and - operators are
+ * interpreted relative to an assumed initial mode of
+ * a=rw.
+ */
mode = getmode (set, 0666);
+ free(set);
break;
case '?':
default:
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index b3726d72df3..d8970123e13 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xinstall.c,v 1.15 1997/12/01 21:17:28 chuck Exp $ */
+/* $OpenBSD: xinstall.c,v 1.16 1998/09/26 09:04:43 deraadt Exp $ */
/* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#endif
-static char rcsid[] = "$OpenBSD: xinstall.c,v 1.15 1997/12/01 21:17:28 chuck Exp $";
+static char rcsid[] = "$OpenBSD: xinstall.c,v 1.16 1998/09/26 09:04:43 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -124,6 +124,7 @@ main(argc, argv)
if (!(set = setmode(optarg)))
errx(EX_USAGE, "%s: invalid file mode", optarg);
mode = getmode(set, 0);
+ free(set);
break;
case 'o':
owner = optarg;