Hi,

	magic is allocated as well, but sometimes it's not freed.

		Michal

--- ../ruby-09-06/dir.c	Fri Sep  6 20:55:37 2002
+++ dir.c	Sat Sep  7 12:12:28 2002
@@ -704,6 +704,7 @@ glob_helper(path, sub, flags, func, arg)
 	    if (stat(dir, &st) < 0) {
 	        if (errno != ENOENT) rb_sys_warning(dir);
 	        free(base);
+		free(magic);
 	        break;
 	    }
 	    if (S_ISDIR(st.st_mode)) {
@@ -719,11 +720,13 @@ glob_helper(path, sub, flags, func, arg)
 		if (dirp == NULL) {
 		    rb_sys_warning(dir);
 		    free(base);
+		    free(magic);
 		    break;
 		}
 	    }
 	    else {
 		free(base);
+		free(magic);
 		break;
 	    }
 	    
@@ -741,6 +744,7 @@ glob_helper(path, sub, flags, func, arg)
 		    sprintf(buf, "%s%s%s", base, (BASE) ? "/" : "", dp->d_name);
 		    if (lstat(buf, &st) < 0) {
 			if (errno != ENOENT) rb_sys_warning(buf);
+			free(buf);
 			continue;
 		    }
 		    if (S_ISDIR(st.st_mode)) {

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos                         Czech Technical University, Prague
E-mail:m.rokos / sh.cvut.cz      ICQ:36118339      Jabber:majkl / jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-