summaryrefslogtreecommitdiffstats
path: root/lib/libedit/parse.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-10-17 06:07:50 +0000
committerderaadt <deraadt@openbsd.org>2014-10-17 06:07:50 +0000
commit014b1be8e77af715a19974acd738d56ba2e3587d (patch)
tree57fcee9bf06edaf401c1d3bda9415c135b02cb20 /lib/libedit/parse.c
parentIn the new world order, setperf does not exist on ramdisks. (diff)
downloadwireguard-openbsd-014b1be8e77af715a19974acd738d56ba2e3587d.tar.xz
wireguard-openbsd-014b1be8e77af715a19974acd738d56ba2e3587d.zip
Remove non-exposed malloc/realloc/free wrappers, and then substitute
reallocarray() where it helps. ok doug
Diffstat (limited to 'lib/libedit/parse.c')
-rw-r--r--lib/libedit/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c
index 9a2d6808139..45b386428c7 100644
--- a/lib/libedit/parse.c
+++ b/lib/libedit/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.11 2011/11/27 21:46:44 pascal Exp $ */
+/* $OpenBSD: parse.c,v 1.12 2014/10/17 06:07:50 deraadt Exp $ */
/* $NetBSD: parse.c,v 1.23 2009/12/30 22:37:40 christos Exp $ */
/*-
@@ -103,14 +103,14 @@ FUN(el,parse)(EditLine *el, int argc, const Char *argv[])
if (ptr == argv[0])
return (0);
l = ptr - argv[0] - 1;
- tprog = el_malloc((l + 1) * sizeof(*tprog));
+ tprog = reallocarray(NULL, l + 1, sizeof(*tprog));
if (tprog == NULL)
return (0);
(void) Strncpy(tprog, argv[0], l);
tprog[l] = '\0';
ptr++;
l = el_match(el->el_prog, tprog);
- el_free(tprog);
+ free(tprog);
if (!l)
return (0);
} else