Problem: Crash when running out of memory in :setfiletype completion.
Solution: Do not allocate memory. (Dominique Pelle, closes #5438)
ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options);
if (ga_grow(ga, num_p) == OK)
- {
+ // take over the pointers and put them in "ga"
for (i = 0; i < num_p; ++i)
{
- ((char_u **)ga->ga_data)[ga->ga_len] =
- vim_strnsave(p[i], (int)STRLEN(p[i]));
+ ((char_u **)ga->ga_data)[ga->ga_len] = p[i];
++ga->ga_len;
}
- }
-
- FreeWild(num_p, p);
+ vim_free(p);
}
}
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 89,
/**/
88,
/**/