summaryrefslogtreecommitdiff
path: root/src/GvimExt
diff options
context:
space:
mode:
Diffstat (limited to 'src/GvimExt')
-rw-r--r--src/GvimExt/gvimext.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp
index 62d925b8a..30b2dddb6 100644
--- a/src/GvimExt/gvimext.cpp
+++ b/src/GvimExt/gvimext.cpp
@@ -1025,7 +1025,7 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
cmdlen = BUFSIZE;
cmdStrW = (wchar_t *) malloc(cmdlen * sizeof(wchar_t));
if (cmdStrW == NULL)
- return;
+ return E_FAIL;
getGvimInvocationW(cmdStrW);
if (useDiff)
@@ -1043,7 +1043,10 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
cmdlen = len + BUFSIZE;
wchar_t *cmdStrW_new = (wchar_t *)realloc(cmdStrW, cmdlen * sizeof(wchar_t));
if (cmdStrW_new == NULL)
- goto theend;
+ {
+ free(cmdStrW);
+ return E_FAIL;
+ }
cmdStrW = cmdStrW_new;
}
wcscat(cmdStrW, L" \"");