summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Pereiaslov <perk11@perk11.info>2023-05-28 02:53:02 -0500
committerKonstantin Pereiaslov <perk11@perk11.info>2023-05-28 02:53:02 -0500
commitc62dc47f6822e7fbd3f3cda9fdb9d16ea59d236c (patch)
tree539d02c96dbdc8352c7635f2f6241ad38a23d6fb
parente3e90723b145db73d2ff7a62867a5a61e20b5434 (diff)
Free memory used for storing shell command string once it's no longer needed.0.2.0
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index c3155bf..38ce3b6 100644
--- a/main.c
+++ b/main.c
@@ -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.