From 2f67ef83328730d710d07fa69d6ee0d707c15bf8 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 9 Oct 2008 14:31:32 +0000 Subject: [PATCH] * process.c (run_exec_dup2): fix resource leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ process.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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;