Skip to content

Commit cd682ea

Browse files
committed
xfree->free
1 parent f41050e commit cd682ea

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ext/mysql2/client.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static VALUE nogvl_close(void *ptr) {
146146
#endif
147147

148148
mysql_close(wrapper->client);
149-
xfree(wrapper->client);
149+
free(wrapper->client);
150150
}
151151

152152
return Qnil;
@@ -157,7 +157,7 @@ static void rb_mysql_client_free(void * ptr) {
157157

158158
nogvl_close(wrapper);
159159

160-
xfree(ptr);
160+
free(ptr);
161161
}
162162

163163
static VALUE allocate(VALUE klass) {
@@ -168,7 +168,7 @@ static VALUE allocate(VALUE klass) {
168168
wrapper->active = 0;
169169
wrapper->reconnect_enabled = 0;
170170
wrapper->closed = 1;
171-
wrapper->client = (MYSQL*)xmalloc(sizeof(MYSQL));
171+
wrapper->client = (MYSQL*)malloc(sizeof(MYSQL));
172172
return obj;
173173
}
174174

@@ -180,19 +180,19 @@ static VALUE rb_mysql_client_escape(RB_MYSQL_UNUSED VALUE klass, VALUE str) {
180180
Check_Type(str, T_STRING);
181181

182182
oldLen = RSTRING_LEN(str);
183-
newStr = xmalloc(oldLen*2+1);
183+
newStr = malloc(oldLen*2+1);
184184

185185
newLen = mysql_escape_string((char *)newStr, StringValuePtr(str), oldLen);
186186
if (newLen == oldLen) {
187187
// no need to return a new ruby string if nothing changed
188-
xfree(newStr);
188+
free(newStr);
189189
return str;
190190
} else {
191191
rb_str = rb_str_new((const char*)newStr, newLen);
192192
#ifdef HAVE_RUBY_ENCODING_H
193193
rb_enc_copy(rb_str, str);
194194
#endif
195-
xfree(newStr);
195+
free(newStr);
196196
return rb_str;
197197
}
198198
}
@@ -489,12 +489,12 @@ static VALUE rb_mysql_client_real_escape(VALUE self, VALUE str) {
489489
#endif
490490

491491
oldLen = RSTRING_LEN(str);
492-
newStr = xmalloc(oldLen*2+1);
492+
newStr = malloc(oldLen*2+1);
493493

494494
newLen = mysql_real_escape_string(wrapper->client, (char *)newStr, StringValuePtr(str), oldLen);
495495
if (newLen == oldLen) {
496496
// no need to return a new ruby string if nothing changed
497-
xfree(newStr);
497+
free(newStr);
498498
return str;
499499
} else {
500500
rb_str = rb_str_new((const char*)newStr, newLen);
@@ -504,7 +504,7 @@ static VALUE rb_mysql_client_real_escape(VALUE self, VALUE str) {
504504
rb_str = rb_str_export_to_enc(rb_str, default_internal_enc);
505505
}
506506
#endif
507-
xfree(newStr);
507+
free(newStr);
508508
return rb_str;
509509
}
510510
}
@@ -877,4 +877,4 @@ void init_mysql2_client() {
877877
rb_const_set(cMysql2Client, rb_intern("BASIC_FLAGS"),
878878
INT2NUM(CLIENT_BASIC_FLAGS));
879879
#endif
880-
}
880+
}

0 commit comments

Comments
 (0)