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 extern.h $NHDT-Date: 1581322657 2020/02/10 08:17:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.795 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1581562570 2020/02/13 02:56:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.796 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2471,7 +2471,7 @@ E void FDECL(fill_room, (struct mkroom *, BOOLEAN_P));
E boolean FDECL(load_special, (const char *));
E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
E struct selectionvar *NDECL(selection_new);
E void FDECL(selection_free, (struct selectionvar *));
E void FDECL(selection_free, (struct selectionvar *, BOOLEAN_P));
#if !defined(IN_SP_LEV_C)
E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int))));
#endif