summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-01-05 17:08:52 -0500
committerEric S. Raymond <esr@thyrsus.com>2016-01-05 17:08:52 -0500
commit1d2d09998f094a8aed07b46b63d9872753c7cf9c (patch)
tree209bd2aa7266e41351e9abd4208f75cf151d76ac /gpsmon.c
parentaa92ce5ace9f5b269b25639f274afa7fd130f503 (diff)
downloadgpsd-1d2d09998f094a8aed07b46b63d9872753c7cf9c.tar.gz
Prevent a memory leak in long-running gpsmon instances.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gpsmon.c b/gpsmon.c
index 3b7a4fb4..ead84d05 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -516,6 +516,8 @@ static bool switch_type(const struct gps_type_t *devtype)
(void)delwin(devicewin);
}
active = newobject;
+ if (devicewin)
+ delwin(devicewin);
devicewin = newwin((*active)->min_y, (*active)->min_x, 1, 0);
/* screen might have JSOM on it from the init sequence */
(void)clearok(stdscr, true);