Problem: GvimExt: realloc() failing is not handled properly.
Solution: Check for NULL return. (Jan-Jaap Korpershoek, closes #3689)
cmdlen = BUFSIZE;
cmdStrW = (wchar_t *) malloc(cmdlen * sizeof(wchar_t));
+ if (cmdStrW == NULL)
+ return;
getGvimInvocationW(cmdStrW);
if (useDiff)
if (len > cmdlen)
{
cmdlen = len + BUFSIZE;
- cmdStrW = (wchar_t *)realloc(cmdStrW, cmdlen * sizeof(wchar_t));
+ wchar_t *cmdStrW_new = (wchar_t *)realloc(cmdStrW, cmdlen * sizeof(wchar_t));
+ if (cmdStrW_new == NULL)
+ goto theend;
+ cmdStrW = cmdStrW_new;
}
wcscat(cmdStrW, L" \"");
wcscat(cmdStrW, m_szFileUserClickedOn);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
-
+theend:
free(cmdStrW);
return NOERROR;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 587,
/**/
586,
/**/