[tor-commits] [tor/master] Free a string buffer in nt_service_install()

nickm at torproject.org nickm at torproject.org
Mon Jun 17 12:54:19 UTC 2019


commit 024d65e14e062803523fb8ee1dd775ef5d2e96fa
Author: Xiaoyin Liu <xiaoyinl at users.noreply.github.com>
Date:   Fri Jun 7 17:13:49 2019 +0800

    Free a string buffer in nt_service_install()
    
    The string buffer "command" is not freed if the specified account
    name doesn't exist. This patch fixes this bug.
---
 src/app/main/ntmain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/app/main/ntmain.c b/src/app/main/ntmain.c
index f00b71270..a2de5bb87 100644
--- a/src/app/main/ntmain.c
+++ b/src/app/main/ntmain.c
@@ -608,6 +608,7 @@ nt_service_install(int argc, char **argv)
                             &sidUse) == 0) {
     /* XXXX For some reason, the above test segfaults. Fix that. */
     printf("User \"%s\" doesn't seem to exist.\n", user_acct);
+    tor_free(command);
     return -1;
   } else {
     printf("Will try to install service as user \"%s\".\n", user_acct);





More information about the tor-commits mailing list