summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-25 18:25:11 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-25 18:25:11 +0000
commit6fc95c18176489d9ec20ac7ded9ba222fd2cbdae (patch)
tree3d5a14dac5ee4b630ad24aec37e116ae64f6f9c0
parent84fbeecf72da4d24cfc7719da03649a6fd530321 (diff)
downloadmpv-6fc95c18176489d9ec20ac7ded9ba222fd2cbdae.tar.bz2
mpv-6fc95c18176489d9ec20ac7ded9ba222fd2cbdae.tar.xz
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
-rw-r--r--playtree.c4
1 files changed, 3 insertions, 1 deletions
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;
}