fix memory leak and out-of-range writes

This commit is contained in:
BVK Chaitanya 2010-09-04 14:22:51 +05:30
parent e77cc389d5
commit 854bd47cb8

View file

@ -72,6 +72,7 @@ merge (char **dest, char **ps)
return 0;
}
dest = p;
for (j = 0; ps[j]; j++)
dest[i++] = ps[j];
dest[i] = 0;