diff options
author | axel <axel@liljencrantz.se> | 2006-02-14 07:44:16 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-02-14 07:44:16 +1000 |
commit | ea5e1b70db6fe69f59361381de1dd62b98eb297f (patch) | |
tree | 4415091ac06a736d872c4af9b0a63ccfca72ab17 | |
parent | 6b393d35a90b13e18b7e25fd28de3343e0ff06f0 (diff) |
Fix memory leak and missing error check in dynamic function lookup
darcs-hash:20060213214416-ac50b-2bd8532aed600c06234e6fce500c737fcb415a5c.gz
-rw-r--r-- | function.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 ); |