Skip to content

Commit

Permalink
free
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking committed Nov 18, 2022
1 parent b9128e7 commit d317fe5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ int main(int argc, char **argv)
}
if (pclose(f)) {
printf("pclose failed\n");
// TODO free sth if failed
return -1;
}

Expand Down Expand Up @@ -161,8 +162,10 @@ int main(int argc, char **argv)
int i = system(s);
if(i != 0){
printf("%s\n", "failed");
free(s);
return i;
}
free(s);
return 0;
}
if(argc == 3 && strcmp(argv[1], "stop") == 0){
Expand Down

0 comments on commit d317fe5

Please sign in to comment.