@@ -339,7 +339,6 @@ rewrite:
339
339
340
340
} else if (query_type == PDO_PLACEHOLDER_POSITIONAL) {
341
341
/* rewrite ? to :pdoX */
342
- char *name;
343
342
const char *tmpl = stmt->named_rewrite_template ? stmt->named_rewrite_template : " :pdo%d" ;
344
343
int bind_no = 1 ;
345
344
@@ -359,10 +358,10 @@ rewrite:
359
358
continue ;
360
359
}
361
360
362
- name = estrndup (plc->pos , plc->len );
361
+ zend_string * name = zend_string_init (plc->pos , plc->len , 0 );
363
362
364
363
/* check if bound parameter is already available */
365
- if (! strcmp (name, " ?" ) || (p = zend_hash_str_find_ptr (stmt->bound_param_map , name, plc-> len )) == NULL ) {
364
+ if (zend_string_equals_literal (name, " ?" ) || (p = zend_hash_find_ptr (stmt->bound_param_map , name)) == NULL ) {
366
365
idxbuf = zend_strpprintf (0 , tmpl, bind_no++);
367
366
} else {
368
367
idxbuf = zend_string_copy (p);
@@ -374,13 +373,13 @@ rewrite:
374
373
375
374
if (!skip_map && stmt->named_rewrite_template ) {
376
375
/* create a mapping */
377
- zend_hash_str_update_ptr (stmt->bound_param_map , name, plc-> len , zend_string_copy (plc->quoted ));
376
+ zend_hash_update_ptr (stmt->bound_param_map , name, zend_string_copy (plc->quoted ));
378
377
}
379
378
380
379
/* map number to name */
381
380
zend_hash_index_update_ptr (stmt->bound_param_map , plc->bindno , zend_string_copy (plc->quoted ));
382
381
383
- efree (name);
382
+ zend_string_release (name);
384
383
}
385
384
386
385
goto rewrite;
0 commit comments