Fixed bug dereferencing garbage, causing crash.
authorEric Mullins <emwine@earthlink.net>
Thu, 1 Oct 2009 22:50:28 +0000 (16:50 -0600)
committerEric Mullins <emwine@earthlink.net>
Thu, 1 Oct 2009 22:50:28 +0000 (16:50 -0600)
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

gamelist.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 7775a99..da123a4
@@ -317,10 +317,6 @@ void ClearGameInfo(gameInfo)
     if (gameInfo->outOfBook != NULL) {
         free(gameInfo->outOfBook);
     }
-    if (gameInfo->resultDetails != NULL) {
-        free(gameInfo->resultDetails);
-    }
-
     GameListInitGameInfo(gameInfo);
 }