[vlc-commits] chromecast: Fix leak on error

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 15 16:47:04 CET 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Feb 15 14:20:40 2016 +0100| [2444495add8303edd1a612c04ec48529e9643d9c] | committer: Hugo Beauzée-Luyssen

chromecast: Fix leak on error

cid #1352639

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

 modules/stream_out/chromecast/chromecast_ctrl.cpp |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index 9357999..c751177 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -111,6 +111,7 @@ int Open(vlc_object_t *p_this)
     intf_sys_t *p_sys = new(std::nothrow) intf_sys_t(p_intf);
     if (unlikely(p_sys == NULL))
         return VLC_ENOMEM;
+    p_intf->p_sys = p_sys;
 
     char *psz_ipChromecast = var_InheritString(p_intf, CONTROL_CFG_PREFIX "addr");
     if (psz_ipChromecast == NULL)
@@ -181,8 +182,6 @@ int Open(vlc_object_t *p_this)
      * to the http server. */
     msleep(2 * CLOCK_FREQ);
 
-    p_intf->p_sys = p_sys;
-
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list