Browse Source

Remove a usage of free()

Nick Mathewson 10 years ago
parent
commit
42e6ab0e14
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/common/sandbox.c

+ 4 - 1
src/common/sandbox.c

@@ -830,7 +830,10 @@ 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);
+      {
+        void *old_val = ((smp_param_t*)el->param)->value;
+        tor_free(old_val);
+      }
       ((smp_param_t*)el->param)->value = (intptr_t) pr_mem_next;
       ((smp_param_t*)el->param)->prot = 1;