]> git.sesse.net Git - vlc/blobdiff - src/misc/update.c
Fix potential memleak.
[vlc] / src / misc / update.c
index dd556a3e5f1fdb539a3f6522fae4cd3fee1e5a41..c8abdcd5bb15a2386f5fcbd24f4260c41984dc4e 100644 (file)
@@ -53,6 +53,7 @@
 #include <vlc_gcrypt.h>
 
 #include "update.h"
+#include "../libvlc.h"
 
 /*****************************************************************************
  * Misc defines
@@ -1365,8 +1366,9 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void
 {
     assert( p_update );
 
-    update_check_thread_t *p_uct = vlc_object_create( p_update->p_libvlc,
-                                            sizeof( update_check_thread_t ) );
+    update_check_thread_t *p_uct =
+        vlc_custom_create( p_update->p_libvlc, sizeof( *p_uct ),
+                           VLC_OBJECT_GENERIC, "update check" );
     if( !p_uct ) return;
 
     p_uct->p_update = p_update;
@@ -1446,8 +1448,9 @@ void update_Download( update_t *p_update, const char *psz_destdir )
 {
     assert( p_update );
 
-    update_download_thread_t *p_udt = vlc_object_create( p_update->p_libvlc,
-                                        sizeof( update_download_thread_t ) );
+    update_download_thread_t *p_udt =
+        vlc_custom_create( p_update->p_libvlc, sizeof( *p_udt ),
+                           VLC_OBJECT_GENERIC, "update download" );
     if( !p_udt )
         return;
 
@@ -1603,7 +1606,7 @@ static void update_DownloadReal( update_download_thread_t *p_udt )
         intf_UserFatal( p_udt, true, _("Invalid signature"),
             _("The cryptographic signature for the downloaded file \"%s\" was "
               "invalid and could not be used to securely verify it. Thus, the "
-              "file was deleted."),,
+              "file was deleted."),
             psz_destfile );
         goto end;
     }