summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-08 10:01:40 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-08 10:01:40 +0000
commit72ba13aa8e86eb7f12bd17737a689ad2ec214036 (patch)
treea45e9d137742a163baea3ee66c918c18b9808b1e /ext
parent4a7311e12977ca2cd388f609c3c705ba219bfee5 (diff)
* 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
Diffstat (limited to 'ext')
-rw-r--r--ext/curses/curses.c2
-rw-r--r--ext/dbm/dbm.c2
-rw-r--r--ext/digest/digest.c2
-rw-r--r--ext/gdbm/gdbm.c2
-rw-r--r--ext/json/ext/parser/parser.c2
-rw-r--r--ext/json/ext/parser/unicode.c8
-rw-r--r--ext/openssl/ossl_cipher.c2
-rw-r--r--ext/openssl/ossl_hmac.c2
-rw-r--r--ext/openssl/ossl_pkey_ec.c4
-rw-r--r--ext/sdbm/init.c2
-rw-r--r--ext/strscan/strscan.c2
-rw-r--r--ext/zlib/zlib.c6
12 files changed, 18 insertions, 18 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 615bd65c56..7d4ed87478 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -635,7 +635,7 @@ static void
curses_mousedata_free(struct mousedata *mdata)
{
if (mdata->mevent)
- free(mdata->mevent);
+ xfree(mdata->mevent);
}
static VALUE
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 8cad97c233..42bd4ff057 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -52,7 +52,7 @@ free_dbm(struct dbmdata *dbmp)
{
if (dbmp) {
if (dbmp->di_dbm) dbm_close(dbmp->di_dbm);
- free(dbmp);
+ xfree(dbmp);
}
}
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index 41565759bb..65ec89a84b 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -469,7 +469,7 @@ rb_digest_base_alloc(VALUE klass)
pctx = xmalloc(algo->ctx_size);
algo->init_func(pctx);
- obj = Data_Wrap_Struct(klass, 0, free, pctx);
+ obj = Data_Wrap_Struct(klass, 0, xfree, pctx);
return obj;
}
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 04fdf886b5..e6a6e0d039 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -110,7 +110,7 @@ free_dbm(struct dbmdata *dbmp)
{
if (dbmp) {
if (dbmp->di_dbm) gdbm_close(dbmp->di_dbm);
- free(dbmp);
+ xfree(dbmp);
}
}
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c
index 5a5d6f1dc4..25a8ae1926 100644
--- a/ext/json/ext/parser/parser.c
+++ b/ext/json/ext/parser/parser.c
@@ -1705,7 +1705,7 @@ static void JSON_mark(JSON_Parser *json)
static void JSON_free(JSON_Parser *json)
{
- free(json);
+ ruby_xfree(json);
}
static VALUE cJSON_parser_s_allocate(VALUE klass)
diff --git a/ext/json/ext/parser/unicode.c b/ext/json/ext/parser/unicode.c
index 609a0e83e2..f196727354 100644
--- a/ext/json/ext/parser/unicode.c
+++ b/ext/json/ext/parser/unicode.c
@@ -105,12 +105,12 @@ char *JSON_convert_UTF16_to_UTF8 (
+ (ch2 - UNI_SUR_LOW_START) + halfBase;
++tmpPtr;
} else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- free(tmp);
+ ruby_xfree(tmp);
rb_raise(rb_path2class("JSON::ParserError"),
"source sequence is illegal/malformed near %s", source);
}
} else { /* We don't have the 16 bits following the high surrogate. */
- free(tmp);
+ ruby_xfree(tmp);
rb_raise(rb_path2class("JSON::ParserError"),
"partial character in source, but hit end near %s", source);
break;
@@ -118,7 +118,7 @@ char *JSON_convert_UTF16_to_UTF8 (
} else if (flags == strictConversion) {
/* UTF-16 surrogate values are illegal in UTF-32 */
if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- free(tmp);
+ ruby_xfree(tmp);
rb_raise(rb_path2class("JSON::ParserError"),
"source sequence is illegal/malformed near %s", source);
}
@@ -150,7 +150,7 @@ char *JSON_convert_UTF16_to_UTF8 (
}
rb_str_buf_cat(buffer, p, bytesToWrite);
}
- free(tmp);
+ ruby_xfree(tmp);
source += 5 + (n - 1) * 6;
return source;
}
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index b680dc6e64..4cae509b23 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -67,7 +67,7 @@ ossl_cipher_free(EVP_CIPHER_CTX *ctx)
{
if (ctx) {
EVP_CIPHER_CTX_cleanup(ctx);
- free(ctx);
+ ruby_xfree(ctx);
}
}
diff --git a/ext/openssl/ossl_hmac.c b/ext/openssl/ossl_hmac.c
index ef77d6c427..f8098bb9c3 100644
--- a/ext/openssl/ossl_hmac.c
+++ b/ext/openssl/ossl_hmac.c
@@ -42,7 +42,7 @@ static void
ossl_hmac_free(HMAC_CTX *ctx)
{
HMAC_CTX_cleanup(ctx);
- free(ctx);
+ ruby_xfree(ctx);
}
static VALUE
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index 210054121d..390c5ace37 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -695,7 +695,7 @@ static void ossl_ec_group_free(ossl_ec_group *ec_group)
{
if (!ec_group->dont_free && ec_group->group)
EC_GROUP_clear_free(ec_group->group);
- free(ec_group);
+ ruby_xfree(ec_group);
}
static VALUE ossl_ec_group_alloc(VALUE klass)
@@ -1201,7 +1201,7 @@ static void ossl_ec_point_free(ossl_ec_point *ec_point)
{
if (!ec_point->dont_free && ec_point->point)
EC_POINT_clear_free(ec_point->point);
- free(ec_point);
+ ruby_xfree(ec_point);
}
static VALUE ossl_ec_point_alloc(VALUE klass)
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 239e7f2975..70480f462b 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -44,7 +44,7 @@ free_sdbm(struct dbmdata *dbmp)
{
if (dbmp->di_dbm) sdbm_close(dbmp->di_dbm);
- free(dbmp);
+ ruby_xfree(dbmp);
}
static VALUE
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index 7c6cf05bf3..622bfae214 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -166,7 +166,7 @@ static void
strscan_free(struct strscanner *p)
{
onig_region_free(&(p->regs), 0);
- free(p);
+ ruby_xfree(p);
}
static VALUE
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index b06ebe3fad..66616fb09f 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -398,7 +398,7 @@ zlib_mem_alloc(voidpf opaque, uInt items, uInt size)
static void
zlib_mem_free(voidpf opaque, voidpf address)
{
- free(address);
+ xfree(address);
}
static void
@@ -793,7 +793,7 @@ zstream_free(struct zstream *z)
if (ZSTREAM_IS_READY(z)) {
zstream_finalize(z);
}
- free(z);
+ xfree(z);
}
static VALUE
@@ -1676,7 +1676,7 @@ gzfile_free(struct gzfile *gz)
}
zstream_finalize(z);
}
- free(gz);
+ xfree(gz);
}
static VALUE