From ea5e1b70db6fe69f59361381de1dd62b98eb297f Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 14 Feb 2006 07:44:16 +1000 Subject: [PATCH] Fix memory leak and missing error check in dynamic function lookup darcs-hash:20060213214416-ac50b-2bd8532aed600c06234e6fce500c737fcb415a5c.gz --- function.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/function.c b/function.c index 58d83f4ec..661f71f2d 100644 --- a/function.c +++ b/function.c @@ -88,6 +88,9 @@ static void autoload_names( array_list_t *out, int get_hidden ) { wchar_t *ndir = (wchar_t *)al_get( &path_list, i ); DIR *dir = wopendir( ndir ); + if( !dir ) + continue; + struct wdirent *next; while( (next=wreaddir(dir))!=0 ) { @@ -101,7 +104,7 @@ static void autoload_names( array_list_t *out, int get_hidden ) { wchar_t *dup; *suffix = 0; - dup = wcsdup( fn ); + dup = intern( fn ); if( !dup ) die_mem(); al_push( out, dup );