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

gEDA-user: dir = g_dir_open() should be freed by g_dir_close(dir)



In g_rc.c

 g_rc_component_library_search()
 g_rc_source_library_search()

calls g_dir_open(), but they never free the result with g_dir_close(),
giving us a memory leak. It seems to been this way since the first
commit.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57

diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index 65c3778..f3e675d 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -601,6 +601,7 @@ SCM g_rc_component_library_search(SCM path)
   }
 
   g_free(string);
+  g_dir_close(dir);
 
   return SCM_BOOL_T;
 }
@@ -717,6 +718,7 @@ SCM g_rc_source_library_search(SCM path)
   }
 
   g_free(string);
+  g_dir_close(dir);
 
   return SCM_BOOL_T;
 }

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user