summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
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 615bd65c565..7d4ed874784 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 8cad97c233c..42bd4ff0574 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 41565759bbc..65ec89a84b3 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 04fdf886b5b..e6a6e0d0397 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 5a5d6f1dc47..25a8ae19262 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 609a0e83e21..f1967273545 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 b680dc6e640..4cae509b230 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 ef77d6c427e..f8098bb9c38 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 210054121d0..390c5ace372 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 239e7f29756..70480f462b5 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 7c6cf05bf39..622bfae2142 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 b06ebe3fad1..66616fb09f5 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