[grilo-plugins/wip/hadess/optical-media-valgrind] optical-media: Fix invalid read error when getting mounts



commit 2fde7d88f697ee0416e39967f858cd93529f64c3
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 22 23:47:53 2019 +0100

    optical-media: Fix invalid read error when getting mounts
    
    ==8716== Invalid read of size 8
    ==8716==    at 0x48DEFA3: g_list_last (glist.c:930)
    ==8716==    by 0x48DEFEE: g_list_append (glist.c:270)
    ==8716==    by 0x150EC886: parsed_finished (grl-optical-media.c:576)
    ==8716==  Address 0x1068bed8 is 8 bytes inside a block of size 24 free'd
    ==8716==    at 0x483897B: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==8716==    by 0x49014D1: g_slice_free_chain_with_offset (gslice.c:1231)
    ==8716==    by 0x150EC542: grl_optical_media_source_browse (grl-optical-media.c:639)
    ==8716==    by 0x487C3B2: browse_idle (grl-source.c:2487)
    ==8716==  Block was alloc'd at
    ==8716==    at 0x483774F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==8716==    by 0x48E8900: g_malloc (gmem.c:99)
    ==8716==    by 0x4900882: g_slice_alloc (gslice.c:1024)
    ==8716==    by 0x48DEFD3: g_list_append (glist.c:264)
    ==8716==    by 0x150EBA9A: parsed_finished_item (grl-optical-media.c:416)

 src/optical-media/grl-optical-media.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/optical-media/grl-optical-media.c b/src/optical-media/grl-optical-media.c
index a00a545..54affe9 100644
--- a/src/optical-media/grl-optical-media.c
+++ b/src/optical-media/grl-optical-media.c
@@ -704,6 +704,7 @@ grl_optical_media_source_browse (GrlSource *source,
   GRL_DEBUG ("%s", __FUNCTION__);
 
   g_list_free_full (priv->list, g_object_unref);
+  priv->list = NULL;
 
   media_list = NULL;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]