home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.169 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  3.6 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.169
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.169
  11. Problem:    Freeing memory already freed, warning from static code analyzer.
  12. Solution:   Initialize pointers to NULL, correct use of "mustfree". (partly by
  13.         Dominique Pelle)
  14. Files:        src/mis1.c
  15.  
  16.  
  17. *** ../vim-7.3.168/src/misc1.c    2011-04-28 13:01:59.000000000 +0200
  18. --- src/misc1.c    2011-04-28 17:42:00.000000000 +0200
  19. ***************
  20. *** 3505,3511 ****
  21.       if (enc_utf8 && var != NULL)
  22.       {
  23.       int    len;
  24. !     char_u  *pp;
  25.   
  26.       /* Convert from active codepage to UTF-8.  Other conversions are
  27.        * not done, because they would fail for non-ASCII characters. */
  28. --- 3505,3511 ----
  29.       if (enc_utf8 && var != NULL)
  30.       {
  31.       int    len;
  32. !     char_u  *pp = NULL;
  33.   
  34.       /* Convert from active codepage to UTF-8.  Other conversions are
  35.        * not done, because they would fail for non-ASCII characters. */
  36. ***************
  37. *** 3872,3882 ****
  38.    * Vim's version of getenv().
  39.    * Special handling of $HOME, $VIM and $VIMRUNTIME.
  40.    * Also does ACP to 'enc' conversion for Win32.
  41.    */
  42.       char_u *
  43.   vim_getenv(name, mustfree)
  44.       char_u    *name;
  45. !     int        *mustfree;    /* set to TRUE when returned is allocated */
  46.   {
  47.       char_u    *p;
  48.       char_u    *pend;
  49. --- 3872,3884 ----
  50.    * Vim's version of getenv().
  51.    * Special handling of $HOME, $VIM and $VIMRUNTIME.
  52.    * Also does ACP to 'enc' conversion for Win32.
  53. +  * "mustfree" is set to TRUE when returned is allocated, it must be
  54. +  * initialized to FALSE by the caller.
  55.    */
  56.       char_u *
  57.   vim_getenv(name, mustfree)
  58.       char_u    *name;
  59. !     int        *mustfree;
  60.   {
  61.       char_u    *p;
  62.       char_u    *pend;
  63. ***************
  64. *** 3898,3904 ****
  65.       if (enc_utf8)
  66.       {
  67.           int        len;
  68. !         char_u  *pp;
  69.   
  70.           /* Convert from active codepage to UTF-8.  Other conversions are
  71.            * not done, because they would fail for non-ASCII characters. */
  72. --- 3900,3906 ----
  73.       if (enc_utf8)
  74.       {
  75.           int        len;
  76. !         char_u  *pp = NULL;
  77.   
  78.           /* Convert from active codepage to UTF-8.  Other conversions are
  79.            * not done, because they would fail for non-ASCII characters. */
  80. ***************
  81. *** 3942,3948 ****
  82.           if (enc_utf8)
  83.           {
  84.           int    len;
  85. !         char_u  *pp;
  86.   
  87.           /* Convert from active codepage to UTF-8.  Other conversions
  88.            * are not done, because they would fail for non-ASCII
  89. --- 3944,3950 ----
  90.           if (enc_utf8)
  91.           {
  92.           int    len;
  93. !         char_u  *pp = NULL;
  94.   
  95.           /* Convert from active codepage to UTF-8.  Other conversions
  96.            * are not done, because they would fail for non-ASCII
  97. ***************
  98. *** 3950,3956 ****
  99.           acp_to_enc(p, (int)STRLEN(p), &pp, &len);
  100.           if (pp != NULL)
  101.           {
  102. !             if (mustfree)
  103.               vim_free(p);
  104.               p = pp;
  105.               *mustfree = TRUE;
  106. --- 3952,3958 ----
  107.           acp_to_enc(p, (int)STRLEN(p), &pp, &len);
  108.           if (pp != NULL)
  109.           {
  110. !             if (*mustfree)
  111.               vim_free(p);
  112.               p = pp;
  113.               *mustfree = TRUE;
  114. *** ../vim-7.3.168/src/version.c    2011-04-28 17:30:05.000000000 +0200
  115. --- src/version.c    2011-04-28 17:48:04.000000000 +0200
  116. ***************
  117. *** 716,717 ****
  118. --- 716,719 ----
  119.   {   /* Add new patch number below this line */
  120. + /**/
  121. +     169,
  122.   /**/
  123.  
  124. -- 
  125. A day without sunshine is like, well, night.
  126.  
  127.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  128. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  129. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  130.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  131.