tvarious memory errors in acme - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit cc0e11e4172af055b3052798881fa03aeaefab44
 (DIR) parent 35368876ebfd1eb9f4e5eddec86cf0176d607386
 (HTM) Author: rsc <devnull@localhost>
       Date:   Sun, 11 Feb 2007 18:42:11 +0000
       
       various memory errors in acme
       
       Diffstat:
         M src/cmd/acme/cols.c                 |       2 +-
         M src/cmd/acme/look.c                 |      10 ++++------
       
       2 files changed, 5 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c
       t@@ -151,7 +151,7 @@ colclose(Column *c, Window *w, int dofree)
                        windelete(w);
                        winclose(w);
                }
       -        memmove(c->w+i, c->w+i+1, (c->nw-i)*sizeof(Window*));
       +        memmove(c->w+i, c->w+i+1, (c->nw-i-1)*sizeof(Window*));
                c->nw--;
                c->w = realloc(c->w, c->nw*sizeof(Window*));
                if(c->nw == 0){
 (DIR) diff --git a/src/cmd/acme/look.c b/src/cmd/acme/look.c
       t@@ -832,15 +832,13 @@ new(Text *et, Text *t, Text *argt, int flag1, int flag2, Rune *arg, int narg)
                        f = runemalloc(nf);
                        runemove(f, arg, nf);
                        rs = dirname(et, f, nf);
       -                f = rs.r;
       -                nf = rs.nr;
                        memset(&e, 0, sizeof e);
       -                e.name = f;
       -                e.nname = nf;
       -                e.bname = runetobyte(f, nf);
       +                e.name = rs.r;
       +                e.nname = rs.nr;
       +                e.bname = runetobyte(rs.r, rs.nr);
                        e.jump = TRUE;
                        openfile(et, &e, FALSE);
       -                free(f);
       +                free(e.name);
                        free(e.bname);
                        arg = skipbl(a, na, &narg);
                }