Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 3d679f3

Fixed some memory leaks.

  • Participants
  • Parent commits 941e9d1

Comments (0)

Files changed (1)

File libfilefind/c_glib_based/filefind.c

 
     if (self->files)
     {
-        g_ptr_array_free(self->files, TRUE);
+        string_array_free(self->files);
         self->files = NULL;
     }
 
 
     if (self->traverse_to)
     {
-        g_ptr_array_free(self->traverse_to, TRUE);
+        string_array_free (self->traverse_to);
         self->traverse_to = NULL;
     }
 
         item->path = NULL;
     }
 
+    if (item->basename)
+    {
+        g_free(item->basename);
+        item->basename = NULL;
+    }
+
     if (item->base)
     {
         g_free(item->base);
         traverse_to = self->current->traverse_to;
 
         self->current->next_traverse_to_idx = 0;
+        
+        for (i = num_children ; i < traverse_to->len ; i++)
+        {
+            g_free(g_ptr_array_index(traverse_to, i));
+        }
 
         g_ptr_array_set_size(traverse_to, num_children);