[#444] io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...>

I am encountering a problem similar to the one mentioned here,

19 messages 2002/09/06
[#453] Re: io_write()/fwrite() and EINTR on Solaris — nobu.nokada@... 2002/09/08

Hi,

[#454] Re: io_write()/fwrite() and EINTR on Solaris — matz@... (Yukihiro Matsumoto) 2002/09/09

Hi

[#469] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/09

On Mon, Sep 09, 2002 at 03:55:13PM +0900, Yukihiro Matsumoto wrote:

[#479] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/10

On Tue, Sep 10, 2002 at 01:04:10AM +0900, Jos Backus wrote:

[#492] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/21

On Wed, Sep 11, 2002 at 02:23:33AM +0900, Jos Backus wrote:

[Fix] Dir mem leak

From: Michal Rokos <m.rokos@...>
Date: 2002-09-09 09:07:07 UTC
List: ruby-core #457
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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In This Thread

Prev Next