Przeglądaj źródła

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.
Xiaoyin Liu 5 lat temu
rodzic
commit
024d65e14e
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      src/app/main/ntmain.c

+ 1 - 0
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);