From 78541dc0a4c7d4bbd83c91e59d38d4f0b8ff4095 Mon Sep 17 00:00:00 2001 From: Byrial Jensen Date: Mon, 19 Dec 2011 16:49:31 +0100 Subject: [PATCH] Fix unportable memory initialisation Memory sat to zero by calloc() cannot safely be assumed to have the pointer value NULL --- xgamelist.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/xgamelist.c b/xgamelist.c index 608e82e..54f417d 100644 --- a/xgamelist.c +++ b/xgamelist.c @@ -479,6 +479,8 @@ GameListPopUp(fp, filename) if (glc == NULL) { glc = (GameListClosure *) calloc(1, sizeof(GameListClosure)); glc->x = glc->y = -1; + glc->filename = NULL; + glc->shell = NULL; } GameListPrepare(False); // [HGM] filter: code put in separate routine @@ -488,7 +490,6 @@ GameListPopUp(fp, filename) if (glc->filename != NULL) free(glc->filename); glc->filename = StrSave(filename); - if (glc->shell == NULL) { glc->shell = GameListCreate(filename, GameListCallback, glc); } else { -- 1.7.0.4