From f9202189990756a29144404785400b80fdf17282 Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Sat, 27 Sep 2008 18:40:05 +0200 Subject: [PATCH] Avoid unnecessary reallocation in mkdtemp function Signed-off-by: Wincent Colaiuta --- ext/mkdtemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mkdtemp.c b/ext/mkdtemp.c index 822b299..8ce25f1 100644 --- a/ext/mkdtemp.c +++ b/ext/mkdtemp.c @@ -40,7 +40,7 @@ static VALUE walrus_dir_mkdtemp_m(int argc, VALUE *argv, VALUE self) char *path = mkdtemp(RSTRING(safe)->ptr); if (path == NULL) rb_raise(rb_eSystemCallError, "mkdtemp failed (error: %d)", errno); - return rb_str_new2(path); + return safe; } void Init_mkdtemp() -- 2.37.1