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
This commit is contained in:
reimar 2009-01-25 18:25:11 +00:00
parent 84fbeecf72
commit 6fc95c1817
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}