summaryrefslogtreecommitdiffstats
path: root/src/sudo.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-04-21 20:29:46 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-04-21 20:29:46 +0200
commit24c1ab6c41fe8a64060b5d47cb6893ab8328d2de (patch)
tree7324d34ef7463f78f8f41bac00479171013fec2a /src/sudo.c
parent3039406e0c3d810cdf911886f73377c13d1cee7e (diff)
src/sudo.c: avoid a warning about SUDO_BIN
Diffstat (limited to 'src/sudo.c')
-rw-r--r--src/sudo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sudo.c b/src/sudo.c
index 9162308..26941f7 100644
--- a/src/sudo.c
+++ b/src/sudo.c
@@ -44,7 +44,7 @@ void run_sudo(int argc, char **argv)
int i;
char **argv2;
argv2 = (char **)MALLOC(sizeof(char *) * (argc + 2));
- argv2[0]=SUDO_BIN;
+ argv2[0]=strdup(SUDO_BIN);
for (i=0; i < argc; i++)
argv2[i+1] = argv[i];
argv2[i+1]=NULL;
@@ -58,6 +58,7 @@ void run_sudo(int argc, char **argv)
printf("Press Enter key to quit.\n");
getchar();
}
+ free(argv2[0]);
free(argv2);
}
#endif