git » libfiu » commit ad7e719

preload/run: Fix strdup memory leak by freeing env_copy

author John Rehn
2024-12-01 14:32:31 UTC
committer Alberto Bertogli
2024-12-02 23:38:28 UTC
parent 6611c79a6f799c8ede9ed56031c2c24c373e0c40

preload/run: Fix strdup memory leak by freeing env_copy

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Edited commit message.

preload/run/run.c +1 -0

diff --git a/preload/run/run.c b/preload/run/run.c
index eff5171..9aac847 100644
--- a/preload/run/run.c
+++ b/preload/run/run.c
@@ -47,5 +47,6 @@ static void __attribute__((constructor)) fiu_run_init(void)
 			}
 			tok = strtok_r(NULL, "\n", &state);
 		}
+		free(env_copy);
 	}
 }