diff options
author | Andrey Hristov <andrey@php.net> | 2010-04-06 13:28:23 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2010-04-06 13:28:23 +0000 |
commit | aa8f43fad9677cc73663bd1a675107d8a8f6af27 (patch) | |
tree | 2dd5e41395ca974dd6bcae3091efc816de22cd8b /ext/mysqlnd/mysqlnd_ps.c | |
parent | 5f11cd5693eeb658d3cbafd3fed7d51df296dafe (diff) | |
download | php-git-aa8f43fad9677cc73663bd1a675107d8a8f6af27.tar.gz |
Recommit with an Windows build fix:
Fix inconsistencies
- memory allocated with spprintf, or likes, outside of mysqlnd's
allocator functions should not be freed by the mysqlnd's allocator
(a wrapper around emalloc/malloc).
- memory allocated by the mysqlnd's allocator should only be freed
by it.
- add a mode to track memory usage (malloc/free)
Diffstat (limited to 'ext/mysqlnd/mysqlnd_ps.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 563c018ad6..1d174ab853 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -599,7 +599,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC) not_bound, not_bound>1 ?"s":""); SET_STMT_ERROR(stmt, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, msg); if (msg) { - efree(msg); + efree(msg); /* allocated by spprintf */ } DBG_INF("FAIL"); DBG_RETURN(FAIL); @@ -2055,7 +2055,7 @@ MYSQLND_METHOD(mysqlnd_stmt, alloc_param_bind)(MYSQLND_STMT * const s TSRMLS_DC) { MYSQLND_STMT_DATA * stmt = s->data; DBG_ENTER("mysqlnd_stmt::alloc_param_bind"); - DBG_RETURN(pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent)); + DBG_RETURN(mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent)); } /* }}} */ @@ -2066,7 +2066,7 @@ MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind)(MYSQLND_STMT * const s TSRMLS_DC { MYSQLND_STMT_DATA * stmt = s->data; DBG_ENTER("mysqlnd_stmt::alloc_result_bind"); - DBG_RETURN(pecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND), stmt->persistent)); + DBG_RETURN(mnd_pecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND), stmt->persistent)); } /* }}} */ |