Ticket #30799: 0001-Free-a-string-buffer-in-nt_service_install.patch

File 0001-Free-a-string-buffer-in-nt_service_install.patch, 931 bytes (added by xiaoyinl, 5 months ago)

patch

  • src/app/main/ntmain.c

    From 99646d83c6cd711fc651640b47713ce6dc6acdc7 Mon Sep 17 00:00:00 2001
    From: Xiaoyin Liu <xiaoyinl@users.noreply.github.com>
    Date: Fri, 7 Jun 2019 17:13:49 +0800
    Subject: [PATCH] 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 b nt_service_install(int argc, char **argv) 
    608608                            &sidUse) == 0) {
    609609    /* XXXX For some reason, the above test segfaults. Fix that. */
    610610    printf("User \"%s\" doesn't seem to exist.\n", user_acct);
     611    tor_free(command);
    611612    return -1;
    612613  } else {
    613614    printf("Will try to install service as user \"%s\".\n", user_acct);