pidof: Do not memleak pidof_root if multiple -c options.
This commit is contained in:
parent
bba9f384c0
commit
ab8b3881a0
1
pidof.c
1
pidof.c
@ -318,6 +318,7 @@ int main (int argc, char **argv)
|
|||||||
case 'c':
|
case 'c':
|
||||||
if (geteuid() == 0) {
|
if (geteuid() == 0) {
|
||||||
opt_rootdir_check = 1;
|
opt_rootdir_check = 1;
|
||||||
|
safe_free(pidof_root);
|
||||||
pidof_root = pid_link(getpid(), "root");
|
pidof_root = pid_link(getpid(), "root");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user