[gegl] buffer: fix memory leak in async file backend



commit dbc89f89150ea2fc04103add9aea4e6c710f1161
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sun Jan 20 17:40:41 2013 -0500

    buffer: fix memory leak in async file backend
    
    In gegl_tile_backend_file_load_index, memory pointed to by new
    was being leaked when existing->tile->rev == item->tile.rev
    
    Found using clang's scan-build.

 gegl/buffer/gegl-tile-backend-file-async.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gegl/buffer/gegl-tile-backend-file-async.c b/gegl/buffer/gegl-tile-backend-file-async.c
index 1aa5cc7..9e2efae 100644
--- a/gegl/buffer/gegl-tile-backend-file-async.c
+++ b/gegl/buffer/gegl-tile-backend-file-async.c
@@ -1053,7 +1053,7 @@ gegl_tile_backend_file_load_index (GeglTileBackendFile *self,
   for (iter = self->tiles; iter; iter=iter->next)
     {
       GeglBufferItem       *item     = iter->data;
-      GeglFileBackendEntry *new      = gegl_tile_backend_file_file_entry_create (0, 0, 0);
+      GeglFileBackendEntry *new;
       GeglFileBackendEntry *existing =
         gegl_tile_backend_file_lookup_entry (self, item->tile.x, item->tile.y, item->tile.z);
 
@@ -1094,6 +1094,7 @@ gegl_tile_backend_file_load_index (GeglTileBackendFile *self,
               g_signal_emit_by_name (storage, "changed", &rect, NULL);
             }
         }
+      new = gegl_tile_backend_file_file_entry_create (0, 0, 0);
       new->tile = iter->data;
       g_hash_table_insert (self->index, new, new);
     }



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