diff --git a/lib/libcurses/fileio.c b/lib/libcurses/fileio.c index f713ae55a31a..ad85617f912a 100644 --- a/lib/libcurses/fileio.c +++ b/lib/libcurses/fileio.c @@ -1,4 +1,4 @@ -/* $NetBSD: fileio.c,v 1.2 2008/05/02 11:13:02 martin Exp $ */ +/* $NetBSD: fileio.c,v 1.3 2008/05/24 16:37:49 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fileio.c,v 1.2 2008/05/02 11:13:02 martin Exp $"); +__RCSID("$NetBSD: fileio.c,v 1.3 2008/05/24 16:37:49 christos Exp $"); #endif /* not lint */ #include "curses.h" @@ -210,6 +210,7 @@ getwin(FILE *fp) win->scr_t = wtmp->scr_t; win->scr_b = wtmp->scr_b; free(wtmp); + wtmp = NULL; __swflags(win); #ifdef HAVE_WCHAR @@ -242,6 +243,7 @@ getwin(FILE *fp) error1: delwin(win); error0: - free(wtmp); + if (wtmp) + free(wtmp); return NULL; }