@@ -3505,7 +3505,7 @@ init_homedir()
35053505 if (enc_utf8 && var != NULL )
35063506 {
35073507 int len ;
3508- char_u * pp ;
3508+ char_u * pp = NULL ;
35093509
35103510 /* Convert from active codepage to UTF-8. Other conversions are
35113511 * not done, because they would fail for non-ASCII characters. */
@@ -3872,11 +3872,13 @@ expand_env_esc(srcp, dst, dstlen, esc, one, startstr)
38723872 * Vim's version of getenv().
38733873 * Special handling of $HOME, $VIM and $VIMRUNTIME.
38743874 * Also does ACP to 'enc' conversion for Win32.
3875+ * "mustfree" is set to TRUE when returned is allocated, it must be
3876+ * initialized to FALSE by the caller.
38753877 */
38763878 char_u *
38773879vim_getenv (name , mustfree )
38783880 char_u * name ;
3879- int * mustfree ; /* set to TRUE when returned is allocated */
3881+ int * mustfree ;
38803882{
38813883 char_u * p ;
38823884 char_u * pend ;
@@ -3898,7 +3900,7 @@ vim_getenv(name, mustfree)
38983900 if (enc_utf8 )
38993901 {
39003902 int len ;
3901- char_u * pp ;
3903+ char_u * pp = NULL ;
39023904
39033905 /* Convert from active codepage to UTF-8. Other conversions are
39043906 * not done, because they would fail for non-ASCII characters. */
@@ -3942,15 +3944,15 @@ vim_getenv(name, mustfree)
39423944 if (enc_utf8 )
39433945 {
39443946 int len ;
3945- char_u * pp ;
3947+ char_u * pp = NULL ;
39463948
39473949 /* Convert from active codepage to UTF-8. Other conversions
39483950 * are not done, because they would fail for non-ASCII
39493951 * characters. */
39503952 acp_to_enc (p , (int )STRLEN (p ), & pp , & len );
39513953 if (pp != NULL )
39523954 {
3953- if (mustfree )
3955+ if (* mustfree )
39543956 vim_free (p );
39553957 p = pp ;
39563958 * mustfree = TRUE;
0 commit comments