[vlc-commits] ntservice: don't use a temporary conversion to printf a wide char string

Steve Lhomme git at videolan.org
Wed Apr 3 10:45:22 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Apr  3 10:44:55 2019 +0200| [987e7371bb8c4739c71a9d41c1f8839b1879867a] | committer: Steve Lhomme

ntservice: don't use a temporary conversion to printf a wide char string

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

 modules/control/ntservice.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/control/ntservice.c b/modules/control/ntservice.c
index 17c66bb771..d0370ffa4c 100644
--- a/modules/control/ntservice.c
+++ b/modules/control/ntservice.c
@@ -201,14 +201,7 @@ static int NTServiceInstall( intf_thread_t *p_intf )
     /* Find out the filename of ourselves so we can install it to the
      * service control manager */
     GetModuleFileName( NULL, psz_pathtmp, MAX_PATH );
-    psz_extra = FromWide( psz_pathtmp );
-    if ( !psz_extra )
-    {
-        CloseServiceHandle( handle );
-        return VLC_ENOMEM;
-    }
-    vlc_memstream_printf( &path_stream, "\"%s\" -I ntservice", psz_extra );
-    free(psz_extra);
+    vlc_memstream_printf( &path_stream, "\"%ls\" -I ntservice", psz_pathtmp );
 
     psz_extra = var_InheritString( p_intf, "ntservice-extraintf" );
     if( psz_extra && *psz_extra )



More information about the vlc-commits mailing list