diff options
author | Cristian Toader <cristian.matei.toader@gmail.com> | 2013-09-06 12:29:15 +0300 |
---|---|---|
committer | Cristian Toader <cristian.matei.toader@gmail.com> | 2013-09-06 12:29:15 +0300 |
commit | 2a6c34750d1723382e0342333ef9a15785adaf66 (patch) | |
tree | 76b3ff5bf9741a513fb13cfcb3e7c7af7b1de409 | |
parent | 42f5737c810622bd1e83caffd27c25908e862597 (diff) | |
download | tor-2a6c34750d1723382e0342333ef9a15785adaf66.tar tor-2a6c34750d1723382e0342333ef9a15785adaf66.tar.gz |
replaced malloc/free with tor_malloc/tor_free
-rw-r--r-- | src/common/sandbox.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c index b4189b5df..0c2145f84 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -728,7 +728,7 @@ prot_strings(sandbox_cfg_t* cfg) 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; @@ -759,13 +759,13 @@ new_element(int syscall, int index, intptr_t value) { 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; } @@ -793,7 +793,7 @@ sandbox_cfg_allow_stat64_filename(sandbox_cfg_t **cfg, char *file, int fr) elem->next = *cfg; *cfg = elem; - if (fr) tor_free_(file); + if (fr) tor_free(file); return 0; } @@ -836,7 +836,7 @@ sandbox_cfg_allow_open_filename(sandbox_cfg_t **cfg, char *file, int fr) elem->next = *cfg; *cfg = elem; - if (fr) tor_free_(file); + if (fr) tor_free(file); return 0; } @@ -879,7 +879,7 @@ sandbox_cfg_allow_openat_filename(sandbox_cfg_t **cfg, char *file, int fr) elem->next = *cfg; *cfg = elem; - if (fr) tor_free_(file); + if (fr) tor_free(file); return 0; } @@ -958,7 +958,7 @@ sandbox_getaddrinfo(const char *name, struct addrinfo hints, 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; } @@ -980,7 +980,7 @@ sandbox_getaddrinfo(const char *name, struct addrinfo hints, // 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; @@ -993,7 +993,7 @@ sandbox_add_addrinfo(const char* name) 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; |