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 --- string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 404abe0b0c..68a4c55990 100644 --- a/string.c +++ b/string.c @@ -609,7 +609,7 @@ rb_str_shared_replace(VALUE str, VALUE str2) return; } if (!STR_SHARED_P(str) && !STR_EMBED_P(str)) { - free(RSTRING_PTR(str)); + xfree(RSTRING_PTR(str)); } STR_SET_NOEMBED(str); STR_UNSET_NOCAPA(str); @@ -3405,7 +3405,7 @@ rb_str_replace(VALUE str, VALUE str2) } if (STR_SHARED_P(str2)) { if (str_independent(str) && !STR_EMBED_P(str)) { - free(RSTRING_PTR(str)); + xfree(RSTRING_PTR(str)); } STR_SET_NOEMBED(str); RSTRING(str)->as.heap.len = len; @@ -3439,7 +3439,7 @@ rb_str_clear(VALUE str) { /* rb_str_modify() */ /* no need for str_make_independent */ if (str_independent(str) && !STR_EMBED_P(str)) { - free(RSTRING_PTR(str)); + xfree(RSTRING_PTR(str)); } STR_SET_EMBED(str); STR_SET_EMBED_LEN(str, 0); @@ -4425,7 +4425,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) t += tlen; } if (!STR_EMBED_P(str)) { - free(RSTRING(str)->as.heap.ptr); + xfree(RSTRING(str)->as.heap.ptr); } *t = '\0'; RSTRING(str)->as.heap.ptr = buf; -- cgit v1.2.3