int i;
if (nargs) {
- vargs = (VARIANT*)emalloc(sizeof(VARIANT) * nargs);
+ vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0);
}
/* Invoke'd args are in reverse order */
nargs = ZEND_NUM_ARGS();
if (nargs) {
- args = (zval **)emalloc(sizeof(zval *) * nargs);
+ args = (zval **)safe_emalloc(sizeof(zval *), nargs, 0);
zend_get_parameters_array(ht, nargs, args);
}
}
if (strlen > 0) {
- olestring = (OLECHAR*)emalloc(sizeof(OLECHAR) * string_len);
+ olestring = (OLECHAR*)safe_emalloc(sizeof(OLECHAR), string_len, 0);
ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len);
} else {
ok = FALSE;
length = WideCharToMultiByte(codepage, 0, olestring, -1, NULL, 0, NULL, NULL);
if (length) {
- string = (char*)emalloc(sizeof(char) * length);
+ string = (char*)safe_emalloc(sizeof(char), length, 0);
length = WideCharToMultiByte(codepage, 0, olestring, -1, string, length, NULL, NULL);
ok = length > 0;
} else {
efree(res);
RETURN_LONG(rows);
} else { /* Was SELECT query */
- res->values = (VResVal *)emalloc(sizeof(VResVal)*cols);
+ res->values = (VResVal *)safe_emalloc(sizeof(VResVal), cols, 0);
res->numcols = cols;
for ( i = 0; i < cols; i++ ) {
SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_NAME,