X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftypes%2Flet_calloc.c;h=152e5c822b4c0bc83f488cd326ced141f543c621;hb=35060621f2fd5079502543d17942127c1a602f72;hp=e14ef69c2690eb5df6e3fbeb6c769e1172fa96e6;hpb=9bcb1df0786a8193d65949c857baaba2f4296e84;p=m6w6%2Fext-psi diff --git a/src/types/let_calloc.c b/src/types/let_calloc.c index e14ef69..152e5c8 100644 --- a/src/types/let_calloc.c +++ b/src/types/let_calloc.c @@ -29,7 +29,7 @@ struct psi_let_calloc *psi_let_calloc_init(struct psi_num_exp *nmemb, struct psi_num_exp *size) { - struct psi_let_calloc *alloc = calloc(1, sizeof(*alloc)); + struct psi_let_calloc *alloc = pecalloc(1, sizeof(*alloc), 1); alloc->nmemb = nmemb; alloc->size = size; @@ -45,9 +45,7 @@ void psi_let_calloc_free(struct psi_let_calloc **alloc_ptr) *alloc_ptr = NULL; psi_num_exp_free(&alloc->nmemb); psi_num_exp_free(&alloc->size); - if (alloc->token) { - free(alloc->token); - } + psi_token_free(&alloc->token); free(alloc); } }