summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.c b/file.c
index c724a4b97c..ac99de6043 100644
--- a/file.c
+++ b/file.c
@@ -406,12 +406,14 @@ static VALUE
stat_new_0(VALUE klass, const struct stat *st)
{
struct stat *nst = 0;
+ VALUE obj = TypedData_Wrap_Struct(klass, &stat_data_type, 0);
if (st) {
nst = ALLOC(struct stat);
*nst = *st;
+ RTYPEDDATA_DATA(obj) = nst;
}
- return TypedData_Wrap_Struct(klass, &stat_data_type, nst);
+ return obj;
}
VALUE