]> granicus.if.org Git - sudo/commitdiff
no need to strdup() a constant
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 2 Jun 1994 21:49:11 +0000 (21:49 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 2 Jun 1994 21:49:11 +0000 (21:49 +0000)
sudo.c

diff --git a/sudo.c b/sudo.c
index 8b05e4c8b28dd5458a065dc5d50a2331a33194ce..dff93ca08bcfb1ca64533a2dcf84bb6b267fe2fc 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -294,12 +294,12 @@ static void load_globals()
            (void) fprintf(stderr, "%s: %s: command not found\n", Argv[0], Argv[1]);
            exit(1);
        }
-    }
 
-    if ((cmnd = strdup(cmnd)) == NULL)  {
-       perror("malloc");
-       (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
-       exit(1);
+       if ((cmnd = strdup(cmnd)) == NULL)  {
+           perror("malloc");
+           (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
+           exit(1);
+       }
     }
 }