Commit 57b7bbe9 authored by Russ Cox's avatar Russ Cox

cmd/dist: fix memory bug (fix builders?)

Thanks, Valgrind!

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5630050
parent a19ab9d1
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment