[tor-commits] [tor/master] fix leak in GETCONF

nickm at torproject.org nickm at torproject.org
Fri Jan 24 20:28:17 UTC 2020


commit f7a2b98674040f191e4a44d59610cc018fccb461
Author: Taylor Yu <catalyst at torproject.org>
Date:   Fri Jan 24 09:06:30 2020 -0600

    fix leak in GETCONF
    
    Fix a memory leak introduced by refactoring of control reply
    formatting code.  Fixes bug 33039; bugfix on 0.4.3.1-alpha.
---
 src/feature/control/control_cmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c
index 5fceb404e..c2d23243e 100644
--- a/src/feature/control/control_cmd.c
+++ b/src/feature/control/control_cmd.c
@@ -323,10 +323,8 @@ handle_control_getconf(control_connection_t *conn,
     send_control_done(conn);
   }
 
-  SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp));
-  smartlist_free(answers);
-  smartlist_free(unrecognized);
-
+  control_reply_free(answers);
+  control_reply_free(unrecognized);
   return 0;
 }
 





More information about the tor-commits mailing list