Patch 8.2.0825
Problem:    def_function() may return pointer that was freed.
Solution:   Set "fp" to NULL after freeing it.
Files:      src/userfunc.c


*** ../vim-8.2.0824/src/userfunc.c      2020-05-25 22:36:46.629735032 +0200
--- src/userfunc.c      2020-05-25 23:07:16.604423874 +0200
***************
*** 3140,3151 ****
--- 3140,3153 ----
                if (fudi.fd_di == NULL)
                {
                    vim_free(fp);
+                   fp = NULL;
                    goto erret;
                }
                if (dict_add(fudi.fd_dict, fudi.fd_di) == FAIL)
                {
                    vim_free(fudi.fd_di);
                    vim_free(fp);
+                   fp = NULL;
                    goto erret;
                }
            }
***************
*** 3169,3174 ****
--- 3171,3177 ----
        else if (hash_add(&func_hashtab, UF2HIKEY(fp)) == FAIL)
        {
            vim_free(fp);
+           fp = NULL;
            goto erret;
        }
        fp->uf_refcount = 1;
*** ../vim-8.2.0824/src/version.c       2020-05-25 23:01:38.781393409 +0200
--- src/version.c       2020-05-25 23:28:48.084239779 +0200
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     825,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
178. You look for an icon to double-click to open your bedroom window.

 /// 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202005252130.04PLU0Qw427260%40masaka.moolenaar.net.

Raspunde prin e-mail lui