Patch 8.0.1435
Problem:    Memory leak in test_arabic.
Solution:   Free the from and to parts. (Christian Brabandt, closes #2569)
Files:      src/buffer.c, src/digraph.c, src/proto/digraph.pro


*** ../vim-8.0.1434/src/buffer.c        2017-12-18 12:37:50.667062757 +0100
--- src/buffer.c        2018-01-28 17:02:22.614398001 +0100
***************
*** 2212,2217 ****
--- 2212,2218 ----
      clear_string_option(&buf->b_p_isk);
  #ifdef FEAT_KEYMAP
      clear_string_option(&buf->b_p_keymap);
+     keymap_clear(&buf->b_kmap_ga);
      ga_clear(&buf->b_kmap_ga);
  #endif
  #ifdef FEAT_COMMENTS
*** ../vim-8.0.1434/src/digraph.c       2017-10-28 21:08:38.975457036 +0200
--- src/digraph.c       2018-01-28 17:02:27.390376412 +0100
***************
*** 2452,2460 ****
      {
        vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s", kp[i].from);
        (void)do_map(1, buf, LANGMAP, FALSE);
-       vim_free(kp[i].from);
-       vim_free(kp[i].to);
      }
  
      p_cpo = save_cpo;
  
--- 2452,2459 ----
      {
        vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s", kp[i].from);
        (void)do_map(1, buf, LANGMAP, FALSE);
      }
+     keymap_clear(&curbuf->b_kmap_ga);
  
      p_cpo = save_cpo;
  
***************
*** 2463,2466 ****
--- 2462,2477 ----
      status_redraw_curbuf();
  }
  
+     void
+ keymap_clear(garray_T *kmap)
+ {
+     int           i;
+     kmap_T  *kp = (kmap_T *)kmap->ga_data;
+ 
+     for (i = 0; i < kmap->ga_len; ++i)
+     {
+       vim_free(kp[i].from);
+       vim_free(kp[i].to);
+     }
+ }
  #endif /* FEAT_KEYMAP */
*** ../vim-8.0.1434/src/proto/digraph.pro       2016-09-12 13:03:59.000000000 
+0200
--- src/proto/digraph.pro       2018-01-28 17:02:36.746333836 +0100
***************
*** 6,9 ****
--- 6,10 ----
  void listdigraphs(void);
  char_u *keymap_init(void);
  void ex_loadkeymap(exarg_T *eap);
+ void keymap_clear(garray_T *kmap);
  /* vim: set ft=c : */
*** ../vim-8.0.1434/src/version.c       2018-01-28 15:36:38.474736247 +0100
--- src/version.c       2018-01-28 16:59:59.243324947 +0100
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1435,
  /**/

-- 
XML is a nice language for computers.  Not for humans.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui