Patch 8.2.4158
Problem:    MS-Windows: memory leak in :browse.
Solution:   Free stuff before returning. (Ken Takata, closes #9574)
Files:      src/gui_w32.c


*** ../vim-8.2.4157/src/gui_w32.c       2022-01-20 12:44:23.519631795 +0000
--- src/gui_w32.c       2022-01-20 15:03:40.609097256 +0000
***************
*** 3587,3592 ****
--- 3587,3593 ----
      WCHAR             *initdirp = NULL;
      WCHAR             *filterp;
      char_u            *p, *q;
+     BOOL              ret;
  
      if (dflt == NULL)
        fileBuf[0] = NUL;
***************
*** 3655,3676 ****
        fileStruct.Flags |= OFN_NODEREFERENCELINKS;
  # endif
      if (saving)
!     {
!       if (!GetSaveFileNameW(&fileStruct))
!           return NULL;
!     }
      else
!     {
!       if (!GetOpenFileNameW(&fileStruct))
!           return NULL;
!     }
  
      vim_free(filterp);
      vim_free(initdirp);
      vim_free(titlep);
      vim_free(extp);
  
!     // Convert from UCS2 to 'encoding'.
      p = utf16_to_enc(fileBuf, NULL);
      if (p == NULL)
        return NULL;
--- 3656,3674 ----
        fileStruct.Flags |= OFN_NODEREFERENCELINKS;
  # endif
      if (saving)
!       ret = GetSaveFileNameW(&fileStruct);
      else
!       ret = GetOpenFileNameW(&fileStruct);
  
      vim_free(filterp);
      vim_free(initdirp);
      vim_free(titlep);
      vim_free(extp);
  
!     if (!ret)
!       return NULL;
! 
!     // Convert from UTF-16 to 'encoding'.
      p = utf16_to_enc(fileBuf, NULL);
      if (p == NULL)
        return NULL;
*** ../vim-8.2.4157/src/version.c       2022-01-20 14:57:18.284528166 +0000
--- src/version.c       2022-01-20 15:05:06.199427469 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4158,
  /**/

-- 
ARTHUR:   Ni!
BEDEVERE: Nu!
ARTHUR:   No.  Ni!  More like this. "Ni"!
BEDEVERE: Ni, ni, ni!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220120150546.50D671C188D%40moolenaar.net.

Raspunde prin e-mail lui