[tor-commits] [tor/master] Remove a usage of free()

nickm at torproject.org nickm at torproject.org
Fri Sep 13 16:31:56 UTC 2013


commit 42e6ab0e14bc3f6c71e262b4c9d888f67beb599f
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Sep 9 14:58:15 2013 -0400

    Remove a usage of free()
---
 src/common/sandbox.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 2f5859e..6fdddd2 100644
--- a/src/common/sandbox.c
+++ b/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;
 





More information about the tor-commits mailing list