diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-12-14 19:54:39 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-12-14 19:54:39 +0100 |
commit | 142a9758151e470307a80ea37b06ea34558ff5b3 (patch) | |
tree | 5ccba6d4a0a2ff4f74bf1c20ae66c4bd0cd8d081 /src/GvimExt | |
parent | 06b056e110005ce0dd97b8c6333405afd06c36fc (diff) | |
download | vim-git-142a9758151e470307a80ea37b06ea34558ff5b3.tar.gz |
patch 8.1.0589: compilation error in gvimext.cppv8.1.0589
Problem: Compilation error in gvimext.cpp.
Solution: Return a value. Also fix using uninitialized variable.
Diffstat (limited to 'src/GvimExt')
-rw-r--r-- | src/GvimExt/gvimext.cpp | 7 |
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" \""); |