From a0439fb51a46e00cee30956c3dc78b94fb9a6ec3 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 11 Nov 2009 18:22:06 +0000 Subject: obvious use after free, found by parfait --- lib/libocurses/newwin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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; } -- cgit v1.2.3