From 6fc95c18176489d9ec20ac7ded9ba222fd2cbdae Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 25 Jan 2009 18:25:11 +0000 Subject: [PATCH] Actually abort (return NULL) in the alloc-failure check in play_tree_new instead of going right ahead and crashing. Patch by Luis Felipe Strano Moraes (luis strano gmail com). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28355 b3059339-0415-0410-9bf9-f77b7e298cf2 --- playtree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playtree.c b/playtree.c index ead621b4fe..2318dd1283 100644 --- a/playtree.c +++ b/playtree.c @@ -21,8 +21,10 @@ play_tree_is_valid(play_tree_t* pt); play_tree_t* play_tree_new(void) { play_tree_t* r = calloc(1,sizeof(play_tree_t)); - if(r == NULL) + if(r == NULL) { mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",(int)sizeof(play_tree_t)); + return NULL; + } r->entry_type = PLAY_TREE_ENTRY_NODE; return r; }