diff --git a/ChangeLog b/ChangeLog index 8f63be0488..542ca3926e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 9 23:30:47 2008 Yusuke Endoh + + * process.c (run_exec_dup2): fix resource leak. + Thu Oct 9 23:19:02 2008 Yusuke Endoh * process.c (rb_run_exec_options): fix resource leak. diff --git a/process.c b/process.c index e1e7cd10bf..e54e174f28 100644 --- a/process.c +++ b/process.c @@ -1854,7 +1854,7 @@ run_exec_dup2(VALUE ary, VALUE save) int j = i; while (j != -1 && pairs[j].oldfd != -1 && pairs[j].num_newer == 0) { if (save_redirect_fd(pairs[j].newfd, save) < 0) - return -1; + goto fail; ret = redirect_dup2(pairs[j].oldfd, pairs[j].newfd); if (ret == -1) goto fail;