[sysprof] capture: dont leak listed files strings



commit b39a43d218280d62ab2c91dc874c103155fc286e
Author: Christian Hergert <chergert redhat com>
Date:   Mon Sep 28 15:56:36 2020 -0700

    capture: dont leak listed files strings
    
    Fix leak introduced by #50

 src/libsysprof-capture/sysprof-capture-reader.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/libsysprof-capture/sysprof-capture-reader.c b/src/libsysprof-capture/sysprof-capture-reader.c
index ce48d7b..41e6af3 100644
--- a/src/libsysprof-capture/sysprof-capture-reader.c
+++ b/src/libsysprof-capture/sysprof-capture-reader.c
@@ -123,6 +123,10 @@ sysprof_capture_reader_finalize (SysprofCaptureReader *self)
 {
   if (self != NULL)
     {
+      for (size_t i = 0; i < self->n_list_files; i++)
+        free (self->list_files[i]);
+      free (self->list_files);
+
       close (self->fd);
       free (self->buf);
       free (self->filename);


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