plug a couple of memory leaks in sp_lev.c, take II

[...]
| Change selection_free(foo) to also free(foo) after freeing foo's
| fields.  Every use was already
|   selection_free(foo);
|   free(foo);
| except for the two instances of memory leak.

And except for the three which aren't in sp_lev.c, one of which was
dealing with memory managed by Lua.  This time it seems to be working
as intended.
This commit is contained in:
PatR
2020-02-12 18:56:41 -08:00
parent 914c78546f
commit 75e9055b89
4 changed files with 41 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do_name.c $NHDT-Date: 1578764034 2020/01/11 17:33:54 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.169 $ */
/* NetHack 3.6 do_name.c $NHDT-Date: 1581562587 2020/02/13 02:56:27 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.172 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -326,7 +326,7 @@ void
gloc_filter_done()
{
if (g.gloc_filter_map) {
selection_free(g.gloc_filter_map);
selection_free(g.gloc_filter_map, TRUE);
g.gloc_filter_map = (struct selectionvar *) 0;
}