memcpy(pr_mem_next, param_val, param_size);
// re-point el parameter to protected
- free((char*) ((smp_param_t*)el->param)->value);
+ tor_free((char*) ((smp_param_t*)el->param)->value);
((smp_param_t*)el->param)->value = (intptr_t) pr_mem_next;
((smp_param_t*)el->param)->prot = 1;
{
smp_param_t *param = NULL;
- sandbox_cfg_t *elem = (sandbox_cfg_t*) malloc(sizeof(sandbox_cfg_t));
+ sandbox_cfg_t *elem = (sandbox_cfg_t*) tor_malloc(sizeof(sandbox_cfg_t));
if (!elem)
return NULL;
- elem->param = (smp_param_t*) malloc(sizeof(smp_param_t));
+ elem->param = (smp_param_t*) tor_malloc(sizeof(smp_param_t));
if (!elem->param) {
- free(elem);
+ tor_free(elem);
return NULL;
}
elem->next = *cfg;
*cfg = elem;
- if (fr) tor_free_(file);
+ if (fr) tor_free(file);
return 0;
}
elem->next = *cfg;
*cfg = elem;
- if (fr) tor_free_(file);
+ if (fr) tor_free(file);
return 0;
}
elem->next = *cfg;
*cfg = elem;
- if (fr) tor_free_(file);
+ if (fr) tor_free(file);
return 0;
}
for (el = sb_addr_info; el; el = el->next) {
if (!strcmp(el->name, name)) {
- *res = (struct addrinfo *) malloc(sizeof(struct addrinfo));
+ *res = (struct addrinfo *) tor_malloc(sizeof(struct addrinfo));
if (!res) {
return -2;
}
// getting here means something went wrong
log_err(LD_BUG,"(Sandbox) failed to get address %s!", name);
if (*res) {
- free(*res);
+ tor_free(*res);
res = NULL;
}
return -1;
struct addrinfo hints;
sb_addr_info_t *el = NULL;
- el = (sb_addr_info_t*) malloc(sizeof(sb_addr_info_t));
+ el = (sb_addr_info_t*) tor_malloc(sizeof(sb_addr_info_t));
if (!el) {
log_err(LD_BUG,"(Sandbox) failed to allocate addr info!");
ret = -2;