# HG changeset patch # User ib # Date 1328798226 0 # Node ID d0617776d506c8aec699f8ef25ede5ab9aa443e8 # Parent dba158d9b986ae7181908518f6d34bf11562b705 Check for allocation error. diff -r dba158d9b986 -r d0617776d506 gui/cfg.c --- a/gui/cfg.c Thu Feb 09 14:26:12 2012 +0000 +++ b/gui/cfg.c Thu Feb 09 14:37:06 2012 +0000 @@ -277,6 +277,12 @@ plItem *item; item = calloc(1, sizeof(plItem)); + + if (!item) { + gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); + mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); + } + item->path = strdup(line); fgetstr(line, sizeof(line), file); item->name = strdup(line); @@ -298,6 +304,12 @@ urlItem *item; item = calloc(1, sizeof(urlItem)); + + if (!item) { + gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); + mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); + } + item->url = strdup(line); listSet(gtkAddURLItem, item); }