diff --git a/rsudo.c b/rsudo.c index 38e9ab7..b971f84 100644 --- a/rsudo.c +++ b/rsudo.c @@ -46,9 +46,6 @@ char *join(char *s1, char *s2) { strcpy(result, s1); strcat(result, s2); } - free(s1); - free(s2); - return result; } @@ -120,7 +117,7 @@ int main(int argc, char **argv) { char *tot = malloc(1); *tot = 0; - for (int i = 1; i < argc; i++) { + for (int i = 1; i < argc - 1; i++) { char *arg = argv[i]; tot = join(tot, arg);