We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ff38b0 commit 1d88eccCopy full SHA for 1d88ecc
src/if_python3.c
@@ -861,15 +861,16 @@ Python3_Init(void)
861
init_structs();
862
863
#ifdef DYNAMIC_PYTHON3
864
- if (p_py3home && *p_py3home != '\0')
+ if (*p_py3home != '\0')
865
{
866
int len;
867
wchar_t *buf;
868
len = mbstowcs(NULL, (char *)p_py3home, 0) + 1;
869
buf = (wchar_t *)alloc(len * sizeof(wchar_t));
870
- if (buf && mbstowcs(buf, (char *)p_py3home, len) != (size_t)-1)
+ if (buf && mbstowcs(buf, (char *)p_py3home, len) != (size_t)-1) {
871
Py_SetPythonHome(buf);
872
- vim_free(buf);
+ /* We must keep buf for Py_SetPythonHome */
873
+ }
874
}
875
# ifdef PYTHON3_HOME
876
else if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
0 commit comments