[vlc-devel] [PATCH] correctly handle realloc() failure
Justus Piater
Justus-bulk at Piater.name
Thu Sep 18 10:10:36 CEST 2008
From: Justus Piater <Justus-dev at Piater.name>
---
src/misc/objects.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 35301a9..55744a1 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -803,8 +803,11 @@ static void vlc_object_detach_unlocked (vlc_object_t *p_this)
if( priv->i_children )
{
- priv->pp_children = (vlc_object_t **)realloc( priv->pp_children,
- priv->i_children * sizeof(vlc_object_t *) );
+ vlc_object_t **pp_children = (vlc_object_t **)
+ realloc( priv->pp_children,
+ priv->i_children * sizeof(vlc_object_t *) );
+ if( pp_children )
+ priv->pp_children = pp_children;
}
else
{
--
1.5.6.5
More information about the vlc-devel
mailing list