From: Eric Mullins Date: Thu, 1 Oct 2009 22:50:28 +0000 (-0600) Subject: Fixed bug dereferencing garbage, causing crash. X-Git-Tag: v4.4.1.20091019~63 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7e9ca02d2427c59cf04b2e9a61010ed5658c2016;p=xboard.git Fixed bug dereferencing garbage, causing crash. Commit fa8be4a3fc5d81e9ec1f6c218fcf55c95d34fd10 included code to free the resultDetails of the gameInfo structure. That exact code exists a few lines above where it was added. None of these free() calls finish by setting the member to NULL afterword, therefore repeated attempts to test/free() the members result in an attempt to free() memory winboard no longer owns, and an eventual crash. link to problematic commit: http://git.savannah.gnu.org/cgit/xboard.git/commit/?id=fa8be4a3fc5d81e9ec1f6c218fcf55c95d34fd10 --- diff --git a/gamelist.c b/gamelist.c old mode 100644 new mode 100755 index 7775a99..da123a4 --- a/gamelist.c +++ b/gamelist.c @@ -317,10 +317,6 @@ void ClearGameInfo(gameInfo) if (gameInfo->outOfBook != NULL) { free(gameInfo->outOfBook); } - if (gameInfo->resultDetails != NULL) { - free(gameInfo->resultDetails); - } - GameListInitGameInfo(gameInfo); }