Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses fix memory leaks (from Rin Okuyama)
details: https://anonhg.NetBSD.org/src/rev/74a84a998a46
branches: trunk
changeset: 341854:74a84a998a46
user: christos <christos%NetBSD.org@localhost>
date: Thu Nov 26 01:05:08 2015 +0000
description:
fix memory leaks (from Rin Okuyama)
diffstat:
lib/libcurses/screen.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (38 lines):
diff -r b1bb2d59763e -r 74a84a998a46 lib/libcurses/screen.c
--- a/lib/libcurses/screen.c Thu Nov 26 01:03:22 2015 +0000
+++ b/lib/libcurses/screen.c Thu Nov 26 01:05:08 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.23 2010/06/10 05:24:55 dholland Exp $ */
+/* $NetBSD: screen.c,v 1.24 2015/11/26 01:05:08 christos Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)screen.c 8.2 (blymn) 11/27/2001";
#else
-__RCSID("$NetBSD: screen.c,v 1.23 2010/06/10 05:24:55 dholland Exp $");
+__RCSID("$NetBSD: screen.c,v 1.24 2015/11/26 01:05:08 christos Exp $");
#endif
#endif /* not lint */
@@ -207,6 +207,10 @@
return new_screen;
error_exit:
+ if (new_screen->term != NULL)
+ (void)del_curterm(new_screen->term);
+ free(new_screen->unget_list);
+
free(new_screen);
return NULL;
}
@@ -239,7 +243,7 @@
_cursesi_free_keymap(screen->base_keymap);
free(screen->stdbuf);
- screen->stdbuf = NULL;
+ free(screen->unget_list);
if (_cursesi_screen == screen)
_cursesi_screen = NULL;
free(screen);
Home |
Main Index |
Thread Index |
Old Index