summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/inp.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2014-11-15 16:35:47 +0000
committertobias <tobias@openbsd.org>2014-11-15 16:35:47 +0000
commite168219741a9fc7d071c56845077db907ff101fc (patch)
tree82b9e5b4d302688dc57f67dcb33592fda99f8a93 /usr.bin/patch/inp.c
parentReword vacation(1)'s one-line description. (diff)
downloadwireguard-openbsd-e168219741a9fc7d071c56845077db907ff101fc.tar.xz
wireguard-openbsd-e168219741a9fc7d071c56845077db907ff101fc.zip
Call munmap with the same size argument as mmap.
ok millert, otto
Diffstat (limited to 'usr.bin/patch/inp.c')
-rw-r--r--usr.bin/patch/inp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
index 15712c9d926..f00da1ea1ab 100644
--- a/usr.bin/patch/inp.c
+++ b/usr.bin/patch/inp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inp.c,v 1.38 2014/10/08 04:06:23 doug Exp $ */
+/* $OpenBSD: inp.c,v 1.39 2014/11/15 16:35:47 tobias Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -72,13 +72,13 @@ void
re_input(void)
{
if (using_plan_a) {
- i_size = 0;
free(i_ptr);
i_ptr = NULL;
if (i_womp != NULL) {
munmap(i_womp, i_size);
i_womp = NULL;
}
+ i_size = 0;
} else {
using_plan_a = true; /* maybe the next one is smaller */
close(tifd);