aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-02-14 07:44:16 +1000
committerGravatar axel <axel@liljencrantz.se>2006-02-14 07:44:16 +1000
commitea5e1b70db6fe69f59361381de1dd62b98eb297f (patch)
tree4415091ac06a736d872c4af9b0a63ccfca72ab17
parent6b393d35a90b13e18b7e25fd28de3343e0ff06f0 (diff)
Fix memory leak and missing error check in dynamic function lookup
darcs-hash:20060213214416-ac50b-2bd8532aed600c06234e6fce500c737fcb415a5c.gz
-rw-r--r--function.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/function.c b/function.c
index 58d83f4e..661f71f2 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 );