[vlc-devel] commit: correctly handle realloc() failure (Justus Piater )
git version control
git at videolan.org
Fri Sep 19 16:56:21 CEST 2008
vlc | branch: master | Justus Piater <Justus-dev at Piater.name> | Thu Sep 18 10:10:36 2008 +0200| [de8a9544f9caf441808a9433077c3ae00e55b1da] | committer: Rémi Denis-Courmont
correctly handle realloc() failure
Signed-off-by: Rémi Denis-Courmont <rdenis at simphalempin.com>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de8a9544f9caf441808a9433077c3ae00e55b1da
---
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
{
More information about the vlc-devel
mailing list