From 72ba13aa8e86eb7f12bd17737a689ad2ec214036 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 8 Jun 2008 10:01:40 +0000 Subject: * array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c, enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- time.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'time.c') diff --git a/time.c b/time.c index e4e4ee2ed1..f6e97244a4 100644 --- a/time.c +++ b/time.c @@ -39,7 +39,7 @@ struct time_object { static void time_free(void *tobj) { - if (tobj) free(tobj); + if (tobj) xfree(tobj); } static VALUE @@ -2028,7 +2028,7 @@ rb_strftime(char **buf, const char *format, struct tm *time) * format string, it's not failing for lack of room. */ if (len > 0 || size >= 1024 * flen) return len; - free(*buf); + xfree(*buf); } /* not reached */ } @@ -2108,7 +2108,7 @@ time_strftime(VALUE time, VALUE format) rb_str_cat(str, buf, len); p += strlen(p); if (buf != buffer) { - free(buf); + xfree(buf); buf = buffer; } for (fmt = p; p < pe && !*p; ++p); @@ -2120,7 +2120,7 @@ time_strftime(VALUE time, VALUE format) len = rb_strftime(&buf, RSTRING_PTR(format), &tobj->tm); } str = rb_str_new(buf, len); - if (buf != buffer) free(buf); + if (buf != buffer) xfree(buf); rb_enc_copy(str, format); return str; } -- cgit v1.2.3