]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Free a string buffer in nt_service_install()
authorXiaoyin Liu <xiaoyinl@users.noreply.github.com>
Fri, 7 Jun 2019 09:13:49 +0000 (17:13 +0800)
committerteor <teor@torproject.org>
Tue, 11 Jun 2019 05:12:20 +0000 (15:12 +1000)
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

index f00b712702fdf4dc0a347feebf487f1a937dd321..a2de5bb87e69b2b17cb2abb8435fe11846002184 100644 (file)
@@ -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);