Memory leak (fixes #2442)
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 1 Feb 2009 07:20:26 +0000 (09:20 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 1 Feb 2009 07:20:26 +0000 (09:20 +0200)
modules/gui/qnx/vout.c

index 4b30fe0..f5a01cb 100644 (file)
@@ -316,9 +316,16 @@ static int QNXManage( vout_thread_t *p_vout )
 
         if( i_ev == Ph_RESIZE_MSG )
         {
+            PhEvent_t *buf;
+
             i_buflen = PhGetMsgSize( p_event );
-            if( ( p_event = realloc( p_event, i_buflen ) ) == NULL )
+            buf = realloc( p_event, i_buflen );
+            if( buf == NULL )
+            {
+                free( p_event );
                 return( 1 );
+            }
+            p_event = buf;
         }
         else if( i_ev == Ph_EVENT_MSG )
         {