[vlc-devel] commit: Check the return value of malloc. ( Rémi Duraffort )

git version control git at videolan.org
Mon Mar 3 13:28:27 CET 2008


vlc | branch: master | Rémi Duraffort <ivoire at via.ecp.fr> | Mon Mar  3 12:24:11 2008 +0100| [51578bdbc5f11f7d4b324bd6ce62f8b205a9b25b]

Check the return value of malloc.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=51578bdbc5f11f7d4b324bd6ce62f8b205a9b25b
---

 src/playlist/item.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index 85992d1..bfd190b 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -715,6 +715,9 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
 {
     vlc_value_t val;
     playlist_add_t *p_add = (playlist_add_t *)malloc( sizeof( playlist_add_t) );
+    if( !p_add )
+        return;
+
     p_add->i_item = i_item_id;
     p_add->i_node = i_node_id;
     val.p_address = p_add;




More information about the vlc-devel mailing list