diff options
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/misc1.c b/src/misc1.c index 593dce1c3..821869aa3 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -3745,8 +3745,7 @@ init_homedir(void) char_u *var; /* In case we are called a second time (when 'encoding' changes). */ - vim_free(homedir); - homedir = NULL; + VIM_CLEAR(homedir); #ifdef VMS var = mch_getenv((char_u *)"SYS$LOGIN"); @@ -4358,10 +4357,7 @@ vim_getenv(char_u *name, int *mustfree) p = vim_strnsave(p, (int)(pend - p)); if (p != NULL && !mch_isdir(p)) - { - vim_free(p); - p = NULL; - } + VIM_CLEAR(p); else { #ifdef USE_EXE_NAME @@ -9775,8 +9771,7 @@ expand_wildcards( /* If the number of matches is now zero, we fail. */ if (*num_files == 0) { - vim_free(*files); - *files = NULL; + VIM_CLEAR(*files); return FAIL; } } @@ -10031,10 +10026,7 @@ dos_expandpath( hFind = FindFirstFileW(wn, &wfb); if (hFind == INVALID_HANDLE_VALUE && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) - { - vim_free(wn); - wn = NULL; - } + VIM_CLEAR(wn); } } @@ -10122,8 +10114,7 @@ dos_expandpath( # endif hFind = FindFirstFile((LPCSTR)buf, &fb); ok = (hFind != INVALID_HANDLE_VALUE); - vim_free(matchname); - matchname = NULL; + VIM_CLEAR(matchname); } } @@ -11256,8 +11247,7 @@ get_cmd_output( if (i != len) { EMSG2(_(e_notread), tempname); - vim_free(buffer); - buffer = NULL; + VIM_CLEAR(buffer); } else if (ret_len == NULL) { |