summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-11-11 18:22:05 +0000
committerderaadt <deraadt@openbsd.org>2009-11-11 18:22:05 +0000
commit2ae0dd064e7ed15575d625eff6b0a0c9db1bc1eb (patch)
tree73924ffb66b4209524a45879ff0de49b588fc76a
parentfix a few memory leaks, found by parfait; ok jsg (diff)
downloadwireguard-openbsd-2ae0dd064e7ed15575d625eff6b0a0c9db1bc1eb.tar.xz
wireguard-openbsd-2ae0dd064e7ed15575d625eff6b0a0c9db1bc1eb.zip
obvious use after free, found by parfait
-rw-r--r--lib/libocurses/newwin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libocurses/newwin.c b/lib/libocurses/newwin.c
index 88480e2c8b2..e55f18b7414 100644
--- a/lib/libocurses/newwin.c
+++ b/lib/libocurses/newwin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newwin.c,v 1.4 2005/08/14 17:15:19 espie Exp $ */
+/* $OpenBSD: newwin.c,v 1.5 2009/11/11 18:22:05 deraadt Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -170,8 +170,8 @@ __makenew(nl, nc, by, bx, sub)
return NULL;
}
if ((win->lspace = malloc (nl * sizeof(__LINE))) == NULL) {
- free (win);
free (win->lines);
+ free (win);
return NULL;
}