summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-11 18:22:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-11 18:22:06 +0000
commita0439fb51a46e00cee30956c3dc78b94fb9a6ec3 (patch)
treea807dddd1f4dc829b1b37af5715fddd6ba6c278d
parent8888c391f2fe5c6b70f99848ce8e5f9a70ba89f3 (diff)
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;
}