From 3c07bc66f02da84668e91ee6f95c4c4bd006f370 Mon Sep 17 00:00:00 2001 From: tg Date: Wed, 12 Nov 2008 06:35:27 +0000 Subject: [PATCH] fix up the fuckage in afree() --- aalloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aalloc.c b/aalloc.c index f84110b..3d68987 100644 --- a/aalloc.c +++ b/aalloc.c @@ -1,6 +1,6 @@ #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 */ @@ -492,9 +492,9 @@ afree(void *vp, PArea ap) bp->last -= PVALIGN; /* mark the last forward pointer as free */ /* if our forward pointer was not the last one, relocate the latter */ 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->iv ^= bp->cookie; /* … forward pointer, and cookie it */