Skip to content

openrc-run: fix memory leaks in PID setup and dependency handling - #1057

Merged
navi-desu merged 1 commit into
OpenRC:masterfrom
pva:fix-memory-leaks
Jul 31, 2026
Merged

openrc-run: fix memory leaks in PID setup and dependency handling#1057
navi-desu merged 1 commit into
OpenRC:masterfrom
pva:fix-memory-leaks

Conversation

@pva

@pva pva commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

setenv() copies its input, so free the temporary PID string after setting RC_OPENRC_PID and RC_RUNSCRIPT_PID.

Also free the reexport list after importing dependency variables. load_dep_env() similarly leaked its dependency list because it mistakenly freed the unrelated global services list instead.

These leaks were reported by LeakSanitizer during service execution.

setenv() copies its input, so free the temporary PID string after setting
RC_OPENRC_PID and RC_RUNSCRIPT_PID.

Also free the reexport list after importing dependency variables.
load_dep_env() similarly leaked its dependency list because it mistakenly
freed the unrelated global services list instead.

These leaks were reported by LeakSanitizer during service execution.
@navi-desu
navi-desu merged commit 3ccf900 into OpenRC:master Jul 31, 2026
5 checks passed
@pva
pva deleted the fix-memory-leaks branch July 31, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants