[vlc-commits] [Git][videolan/vlc][master] 2 commits: medialibrary: Create a `vlc_folder_release_inner` wrapper

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Mon May 23 15:03:02 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
fd30565a by Alaric Senat at 2022-05-23T14:20:03+00:00
medialibrary: Create a `vlc_folder_release_inner` wrapper

To ease the proper freeing of all the `vlc_ml_folder_t` fields.

- - - - -
941479da by Alaric Senat at 2022-05-23T14:20:03+00:00
medialibrary: Properly free all `vlc_ml_folder_t` fields

- - - - -


1 changed file:

- src/misc/medialibrary.c


Changes:

=====================================
src/misc/medialibrary.c
=====================================
@@ -274,11 +274,17 @@ void vlc_ml_media_release( vlc_ml_media_t* p_media )
     free( p_media );
 }
 
+static void vlc_folder_release_inner( vlc_ml_folder_t* p_folder )
+{
+    free( p_folder->psz_name );
+    free( p_folder->psz_mrl );
+}
+
 void vlc_ml_folder_release( vlc_ml_folder_t* p_folder )
 {
     if ( p_folder == NULL )
         return;
-    free( p_folder->psz_mrl );
+    vlc_folder_release_inner( p_folder );
     free( p_folder );
 }
 
@@ -371,7 +377,7 @@ void vlc_ml_folder_list_release( vlc_ml_folder_list_t* p_list )
     if ( p_list == NULL )
         return;
     for ( size_t i = 0; i < p_list->i_nb_items; ++i )
-        free( p_list->p_items[i].psz_mrl );
+        vlc_folder_release_inner( &p_list->p_items[i] );
     free( p_list );
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/36f248985db31e1ce800f7cbde4f735239e63c95...941479da0dbd337cf26766b5341b533f098cf88b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/36f248985db31e1ce800f7cbde4f735239e63c95...941479da0dbd337cf26766b5341b533f098cf88b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list