1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Useless check for NULL when calling vim_free().
12 Solution: Remove the check. (Dominique Pelle)
13 Files: src/eval.c, src/ex_cmds.c, src/os_win32.c
16 *** ../vim-7.3.107/src/eval.c 2011-01-22 01:13:33.000000000 +0100
17 --- src/eval.c 2011-01-30 21:37:53.000000000 +0100
28 *arg = skipwhite(*arg);
36 *arg = skipwhite(*arg);
39 EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name);
42 ! /* Don't allow hiding a function. When "v" is not NULL we migth be
43 * assigning another function to the same var, the type is checked
45 if (v == NULL && function_exists(name))
47 EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name);
50 ! /* Don't allow hiding a function. When "v" is not NULL we might be
51 * assigning another function to the same var, the type is checked
53 if (v == NULL && function_exists(name))
54 *** ../vim-7.3.107/src/ex_cmds.c 2010-12-17 18:06:00.000000000 +0100
55 --- src/ex_cmds.c 2011-01-30 21:37:53.000000000 +0100
61 ! if (old_sub != NULL && force)
63 if (force || old_sub == NULL)
64 old_sub = viminfo_readstring(virp, 1, TRUE);
71 if (force || old_sub == NULL)
72 old_sub = viminfo_readstring(virp, 1, TRUE);
73 *** ../vim-7.3.107/src/os_win32.c 2010-12-17 20:23:56.000000000 +0100
74 --- src/os_win32.c 2011-01-30 21:37:53.000000000 +0100
77 cb->BufferSize.X = cb->Info.dwSize.X;
78 cb->BufferSize.Y = cb->Info.dwSize.Y;
79 NumCells = cb->BufferSize.X * cb->BufferSize.Y;
80 ! if (cb->Buffer != NULL)
81 ! vim_free(cb->Buffer);
82 cb->Buffer = (PCHAR_INFO)alloc(NumCells * sizeof(CHAR_INFO));
83 if (cb->Buffer == NULL)
86 cb->BufferSize.X = cb->Info.dwSize.X;
87 cb->BufferSize.Y = cb->Info.dwSize.Y;
88 NumCells = cb->BufferSize.X * cb->BufferSize.Y;
89 ! vim_free(cb->Buffer);
90 cb->Buffer = (PCHAR_INFO)alloc(NumCells * sizeof(CHAR_INFO));
91 if (cb->Buffer == NULL)
93 *** ../vim-7.3.107/src/version.c 2011-01-22 21:25:07.000000000 +0100
94 --- src/version.c 2011-02-01 13:47:07.000000000 +0100
98 { /* Add new patch number below this line */
104 hundred-and-one symptoms of being an internet addict:
105 173. You keep tracking down the email addresses of all your friends
106 (even childhood friends).
108 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
109 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
110 \\\ an exciting new programming language -- http://www.Zimbu.org ///
111 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///