diff options
author | 2014-10-17 06:07:50 +0000 | |
---|---|---|
committer | 2014-10-17 06:07:50 +0000 | |
commit | 014b1be8e77af715a19974acd738d56ba2e3587d (patch) | |
tree | 57fcee9bf06edaf401c1d3bda9415c135b02cb20 /lib/libedit/filecomplete.c | |
parent | In the new world order, setperf does not exist on ramdisks. (diff) | |
download | wireguard-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/filecomplete.c')
-rw-r--r-- | lib/libedit/filecomplete.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c index a6de8de79fa..5eda39113c6 100644 --- a/lib/libedit/filecomplete.c +++ b/lib/libedit/filecomplete.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filecomplete.c,v 1.3 2014/10/11 03:10:06 doug Exp $ */ +/* $OpenBSD: filecomplete.c,v 1.4 2014/10/17 06:07:50 deraadt Exp $ */ /* $NetBSD: filecomplete.c,v 1.22 2010/12/02 04:42:46 dholland Exp $ */ /*- @@ -433,11 +433,7 @@ fn_complete(EditLine *el, ctemp--; len = li->cursor - ctemp; -#if defined(__SSP__) || defined(__SSP_ALL__) - temp = malloc(sizeof(*temp) * (len + 1)); -#else - temp = alloca(sizeof(*temp) * (len + 1)); -#endif + temp = reallocarray(NULL, len + 1, sizeof(*temp)); (void)Strncpy(temp, ctemp, len); temp[len] = '\0'; @@ -552,9 +548,7 @@ fn_complete(EditLine *el, free(matches); matches = NULL; } -#if defined(__SSP__) || defined(__SSP_ALL__) free(temp); -#endif return retval; } |