struct psi_number *psi_number_init(token_t t, void *num, unsigned flags)
{
- struct psi_number *exp = calloc(1, sizeof(*exp));
+ struct psi_number *exp = pecalloc(1, sizeof(*exp), 1);
exp->flags = flags;
switch (exp->type = t) {
struct psi_number *psi_number_copy(struct psi_number *exp)
{
- struct psi_number *num = calloc(1, sizeof(*num));
+ struct psi_number *num = pecalloc(1, sizeof(*num), 1);
*num = *exp;
struct psi_number *exp = *exp_ptr;
*exp_ptr = NULL;
- if (exp->token) {
- free(exp->token);
- }
+ psi_token_free(&exp->token);
switch (exp->type) {
case PSI_T_INT8:
case PSI_T_UINT8: