mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
A better fix. Read nextPtr before mem gets freed.
-Erik
This commit is contained in:
parent
f9ff8a7d90
commit
a4edd0e946
12
init.c
12
init.c
@ -599,7 +599,8 @@ static void check_memory()
|
|||||||
static void run_lastAction(void)
|
static void run_lastAction(void)
|
||||||
{
|
{
|
||||||
initAction *a, *tmp;
|
initAction *a, *tmp;
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == CTRLALTDEL) {
|
if (a->action == CTRLALTDEL) {
|
||||||
waitfor(a->process, a->console, FALSE);
|
waitfor(a->process, a->console, FALSE);
|
||||||
delete_initAction(a);
|
delete_initAction(a);
|
||||||
@ -938,7 +939,8 @@ extern int init_main(int argc, char **argv)
|
|||||||
/* Now run everything that needs to be run */
|
/* Now run everything that needs to be run */
|
||||||
|
|
||||||
/* First run the sysinit command */
|
/* First run the sysinit command */
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == SYSINIT) {
|
if (a->action == SYSINIT) {
|
||||||
waitfor(a->process, a->console, FALSE);
|
waitfor(a->process, a->console, FALSE);
|
||||||
/* Now remove the "sysinit" entry from the list */
|
/* Now remove the "sysinit" entry from the list */
|
||||||
@ -946,7 +948,8 @@ extern int init_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Next run anything that wants to block */
|
/* Next run anything that wants to block */
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == WAIT) {
|
if (a->action == WAIT) {
|
||||||
waitfor(a->process, a->console, FALSE);
|
waitfor(a->process, a->console, FALSE);
|
||||||
/* Now remove the "wait" entry from the list */
|
/* Now remove the "wait" entry from the list */
|
||||||
@ -954,7 +957,8 @@ extern int init_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Next run anything to be run only once */
|
/* Next run anything to be run only once */
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == ONCE) {
|
if (a->action == ONCE) {
|
||||||
run(a->process, a->console, FALSE);
|
run(a->process, a->console, FALSE);
|
||||||
/* Now remove the "once" entry from the list */
|
/* Now remove the "once" entry from the list */
|
||||||
|
12
init/init.c
12
init/init.c
@ -599,7 +599,8 @@ static void check_memory()
|
|||||||
static void run_lastAction(void)
|
static void run_lastAction(void)
|
||||||
{
|
{
|
||||||
initAction *a, *tmp;
|
initAction *a, *tmp;
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == CTRLALTDEL) {
|
if (a->action == CTRLALTDEL) {
|
||||||
waitfor(a->process, a->console, FALSE);
|
waitfor(a->process, a->console, FALSE);
|
||||||
delete_initAction(a);
|
delete_initAction(a);
|
||||||
@ -938,7 +939,8 @@ extern int init_main(int argc, char **argv)
|
|||||||
/* Now run everything that needs to be run */
|
/* Now run everything that needs to be run */
|
||||||
|
|
||||||
/* First run the sysinit command */
|
/* First run the sysinit command */
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == SYSINIT) {
|
if (a->action == SYSINIT) {
|
||||||
waitfor(a->process, a->console, FALSE);
|
waitfor(a->process, a->console, FALSE);
|
||||||
/* Now remove the "sysinit" entry from the list */
|
/* Now remove the "sysinit" entry from the list */
|
||||||
@ -946,7 +948,8 @@ extern int init_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Next run anything that wants to block */
|
/* Next run anything that wants to block */
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == WAIT) {
|
if (a->action == WAIT) {
|
||||||
waitfor(a->process, a->console, FALSE);
|
waitfor(a->process, a->console, FALSE);
|
||||||
/* Now remove the "wait" entry from the list */
|
/* Now remove the "wait" entry from the list */
|
||||||
@ -954,7 +957,8 @@ extern int init_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Next run anything to be run only once */
|
/* Next run anything to be run only once */
|
||||||
for (a = tmp = initActionList; a; a = tmp = tmp->nextPtr) {
|
for (a = initActionList; a; a = tmp) {
|
||||||
|
tmp = a->nextPtr;
|
||||||
if (a->action == ONCE) {
|
if (a->action == ONCE) {
|
||||||
run(a->process, a->console, FALSE);
|
run(a->process, a->console, FALSE);
|
||||||
/* Now remove the "once" entry from the list */
|
/* Now remove the "once" entry from the list */
|
||||||
|
Loading…
Reference in New Issue
Block a user