fix up the fuckage in afree()
This commit is contained in:
parent
c6bcbc7bb0
commit
3c07bc66f0
6
aalloc.c
6
aalloc.c
@ -1,6 +1,6 @@
|
|||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/aalloc.c,v 1.16 2008/11/12 06:14:26 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/aalloc.c,v 1.17 2008/11/12 06:35:27 tg Exp $");
|
||||||
|
|
||||||
/* mksh integration of aalloc */
|
/* mksh integration of aalloc */
|
||||||
|
|
||||||
@ -492,9 +492,9 @@ afree(void *vp, PArea ap)
|
|||||||
bp->last -= PVALIGN; /* mark the last forward pointer as free */
|
bp->last -= PVALIGN; /* mark the last forward pointer as free */
|
||||||
/* if our forward pointer was not the last one, relocate the latter */
|
/* if our forward pointer was not the last one, relocate the latter */
|
||||||
if (ptr->pv < bp->last) {
|
if (ptr->pv < bp->last) {
|
||||||
TPtr *tmp;
|
TPtr *tmp = *((TPtr **)bp->last);
|
||||||
|
|
||||||
tmp = (TPtr *)bp->last; /* former last forward pointer */
|
/* tmp is the former last forward pointer */
|
||||||
tmp->pv = ptr->pv; /* its backpointer to former our … */
|
tmp->pv = ptr->pv; /* its backpointer to former our … */
|
||||||
tmp->iv ^= bp->cookie; /* … forward pointer, and cookie it */
|
tmp->iv ^= bp->cookie; /* … forward pointer, and cookie it */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user