Skip to content

Commit

Permalink
Free memory used for storing shell command string once it's no longer…
Browse files Browse the repository at this point in the history
… needed.
  • Loading branch information
perk11 committed May 28, 2023
1 parent e3e9072 commit c62dc47
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ int main(int argc, char *argv[]) {
XScreenSaverInfo *info = XScreenSaverAllocInfo();

pid = run_shell_command(shell_command_to_run, pid);
free(shell_command_to_run);

// Let command run for 300ms to give it a chance to error-out or provide initial output.
// 300ms is chosen to avoid giving user a noticeable delay while giving most quick commands a chance to finish.
Expand Down

0 comments on commit c62dc47

Please sign in to comment.