From: PatR Date: Thu, 26 May 2016 00:25:47 +0000 (-0700) Subject: unix mail cleanup bulletproofing X-Git-Tag: NetHack-3.6.1_RC01~741 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8d1f44272a6d0cf3f46fbe8dd34b7ae33fced46;p=nethack unix mail cleanup bulletproofing If the recently added release routine ever gets called twice for some reason, don't free already freed memory, or worse, was freed here and then allocated for something else which is still in use. --- diff --git a/src/mail.c b/src/mail.c index 9c09fdc47..06ce1b266 100644 --- a/src/mail.c +++ b/src/mail.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mail.c $NHDT-Date: 1451955080 2016/01/05 00:51:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.25 $ */ +/* NetHack 3.6 mail.c $NHDT-Date: 1464222344 2016/05/26 00:25:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.27 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -84,7 +84,7 @@ void free_maildata() { if (mailbox) - free(mailbox); + free((genericptr_t) mailbox), mailbox = (char *) 0; } void