From aa8f43fad9677cc73663bd1a675107d8a8f6af27 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Tue, 6 Apr 2010 13:28:23 +0000 Subject: 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) --- ext/mysqlnd/mysqlnd_ps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/mysqlnd/mysqlnd_ps.c') 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)); } /* }}} */ -- cgit v1.2.1