]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: fix memory bug (fix builders?)
authorRuss Cox <rsc@golang.org>
Sat, 4 Feb 2012 07:15:53 +0000 (02:15 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 4 Feb 2012 07:15:53 +0000 (02:15 -0500)
Thanks, Valgrind!

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5630050

src/cmd/dist/buf.c

index c7a7c1277c78a7931ffc74a003d6d6ebc5c18c90..c990c8af7859c786ceec736902222acb933103ae 100644 (file)
@@ -227,7 +227,7 @@ vuniq(Vec *v)
        xqsort(v->p, v->len, sizeof(v->p[0]), strpcmp);
        n = 0;
        for(i=0; i<v->len; i++) {
-               if(i>0 && streq(v->p[i], v->p[i-1]))
+               if(n>0 && streq(v->p[i], v->p[n-1]))
                        xfree(v->p[i]);
                else
                        v->p[n++] = v->p[i];