[vlc-commits] cli: use vlc_obj_malloc()

Rémi Denis-Courmont git at videolan.org
Sun Nov 29 14:56:04 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 29 12:56:58 2020 +0200| [f423edd0c73c5b6c23374693c2ebaff2543e6ec4] | committer: Rémi Denis-Courmont

cli: use vlc_obj_malloc()

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

 modules/control/cli/cli.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/control/cli/cli.c b/modules/control/cli/cli.c
index 0196b26d57..0ce26c1a57 100644
--- a/modules/control/cli/cli.c
+++ b/modules/control/cli/cli.c
@@ -896,7 +896,7 @@ static int Activate( vlc_object_t *p_this )
         free( psz_host );
     }
 
-    intf_sys_t *p_sys = malloc( sizeof( *p_sys ) );
+    intf_sys_t *p_sys = vlc_obj_malloc(p_this, sizeof (*p_sys));
     if( unlikely(p_sys == NULL) )
     {
         net_ListenClose( pi_socket );
@@ -962,7 +962,6 @@ error:
     tdestroy(p_sys->commands, free);
     net_ListenClose( pi_socket );
     free( psz_unix_path );
-    free( p_sys );
     return VLC_EGENERIC;
 }
 
@@ -1006,7 +1005,6 @@ static void Deactivate( vlc_object_t *p_this )
             net_Close(p_sys->i_socket);
 #endif
     }
-    free( p_sys );
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list