Problem: In cs_insert_filelist() a failed vim_realloc() when growing the
csinfo[] array frees the array and resets csinfo/csinfo_size,
discarding the still-open existing connections: their fname,
ppath and flags are leaked and the cscope child processes are
orphaned, since cs_end()/cs_reset() can no longer reach them.
(Ao Xijie)
Solution: On realloc() failure keep the original array, which is still
valid, and only fail to add the new database.
closes: #20662
Supported by AI.
Signed-off-by: Christian Brabandt <cb@256bit.org>
csinfo = vim_realloc(csinfo, sizeof(csinfo_T)*csinfo_size);
if (csinfo == NULL)
{
- vim_free(t_csinfo);
- csinfo_size = 0;
+ // allocation failure, so keep the old infos
+ csinfo = t_csinfo;
+ csinfo_size = i;
+ return -1;
}
}
if (csinfo == NULL)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 747,
/**/
746,
/**/