[MPlayer-cvslog] r28355 - trunk/playtree.c

reimar subversion at mplayerhq.hu
Sun Jan 25 19:25:12 CET 2009


Author: reimar
Date: Sun Jan 25 19:25:11 2009
New Revision: 28355

Log:
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).

Modified:
   trunk/playtree.c

Modified: trunk/playtree.c
==============================================================================
--- trunk/playtree.c	Sun Jan 25 19:23:05 2009	(r28354)
+++ trunk/playtree.c	Sun Jan 25 19:25:11 2009	(r28355)
@@ -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;
 }



More information about the MPlayer-cvslog mailing list