@@ -146,7 +146,7 @@ static VALUE nogvl_close(void *ptr) {
146
146
#endif
147
147
148
148
mysql_close (wrapper -> client );
149
- xfree (wrapper -> client );
149
+ free (wrapper -> client );
150
150
}
151
151
152
152
return Qnil ;
@@ -157,7 +157,7 @@ static void rb_mysql_client_free(void * ptr) {
157
157
158
158
nogvl_close (wrapper );
159
159
160
- xfree (ptr );
160
+ free (ptr );
161
161
}
162
162
163
163
static VALUE allocate (VALUE klass ) {
@@ -168,7 +168,7 @@ static VALUE allocate(VALUE klass) {
168
168
wrapper -> active = 0 ;
169
169
wrapper -> reconnect_enabled = 0 ;
170
170
wrapper -> closed = 1 ;
171
- wrapper -> client = (MYSQL * )xmalloc (sizeof (MYSQL ));
171
+ wrapper -> client = (MYSQL * )malloc (sizeof (MYSQL ));
172
172
return obj ;
173
173
}
174
174
@@ -180,19 +180,19 @@ static VALUE rb_mysql_client_escape(RB_MYSQL_UNUSED VALUE klass, VALUE str) {
180
180
Check_Type (str , T_STRING );
181
181
182
182
oldLen = RSTRING_LEN (str );
183
- newStr = xmalloc (oldLen * 2 + 1 );
183
+ newStr = malloc (oldLen * 2 + 1 );
184
184
185
185
newLen = mysql_escape_string ((char * )newStr , StringValuePtr (str ), oldLen );
186
186
if (newLen == oldLen ) {
187
187
// no need to return a new ruby string if nothing changed
188
- xfree (newStr );
188
+ free (newStr );
189
189
return str ;
190
190
} else {
191
191
rb_str = rb_str_new ((const char * )newStr , newLen );
192
192
#ifdef HAVE_RUBY_ENCODING_H
193
193
rb_enc_copy (rb_str , str );
194
194
#endif
195
- xfree (newStr );
195
+ free (newStr );
196
196
return rb_str ;
197
197
}
198
198
}
@@ -489,12 +489,12 @@ static VALUE rb_mysql_client_real_escape(VALUE self, VALUE str) {
489
489
#endif
490
490
491
491
oldLen = RSTRING_LEN (str );
492
- newStr = xmalloc (oldLen * 2 + 1 );
492
+ newStr = malloc (oldLen * 2 + 1 );
493
493
494
494
newLen = mysql_real_escape_string (wrapper -> client , (char * )newStr , StringValuePtr (str ), oldLen );
495
495
if (newLen == oldLen ) {
496
496
// no need to return a new ruby string if nothing changed
497
- xfree (newStr );
497
+ free (newStr );
498
498
return str ;
499
499
} else {
500
500
rb_str = rb_str_new ((const char * )newStr , newLen );
@@ -504,7 +504,7 @@ static VALUE rb_mysql_client_real_escape(VALUE self, VALUE str) {
504
504
rb_str = rb_str_export_to_enc (rb_str , default_internal_enc );
505
505
}
506
506
#endif
507
- xfree (newStr );
507
+ free (newStr );
508
508
return rb_str ;
509
509
}
510
510
}
@@ -877,4 +877,4 @@ void init_mysql2_client() {
877
877
rb_const_set (cMysql2Client , rb_intern ("BASIC_FLAGS" ),
878
878
INT2NUM (CLIENT_BASIC_FLAGS ));
879
879
#endif
880
- }
880
+ }
0 commit comments