Attached is a minor patch which removes some useless
checks for NULL pointer before calling vim_free() since
vim_free() already checks for NULL pointer.

-- Dominique

-- 
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
diff -r 26fb122355d4 src/eval.c
--- a/src/eval.c	Sat Jan 22 21:25:11 2011 +0100
+++ b/src/eval.c	Sun Jan 30 00:32:03 2011 +0100
@@ -5106,9 +5106,7 @@
 	    else
 		ret = OK;
 	}
-
-	if (alias != NULL)
-	    vim_free(alias);
+	vim_free(alias);
     }
 
     *arg = skipwhite(*arg);
@@ -19807,7 +19805,7 @@
 	    EMSG2(_("E704: Funcref variable name must start with a capital: %s"), name);
 	    return;
 	}
-	/* Don't allow hiding a function.  When "v" is not NULL we migth be
+	/* Don't allow hiding a function.  When "v" is not NULL we might be
 	 * assigning another function to the same var, the type is checked
 	 * below. */
 	if (v == NULL && function_exists(name))
diff -r 26fb122355d4 src/ex_cmds.c
--- a/src/ex_cmds.c	Sat Jan 22 21:25:11 2011 +0100
+++ b/src/ex_cmds.c	Sun Jan 30 00:32:03 2011 +0100
@@ -5412,7 +5412,7 @@
     vir_T	*virp;
     int		force;
 {
-    if (old_sub != NULL && force)
+    if (force)
 	vim_free(old_sub);
     if (force || old_sub == NULL)
 	old_sub = viminfo_readstring(virp, 1, TRUE);
diff -r 26fb122355d4 src/os_win32.c
--- a/src/os_win32.c	Sat Jan 22 21:25:11 2011 +0100
+++ b/src/os_win32.c	Sun Jan 30 00:32:03 2011 +0100
@@ -1886,8 +1886,7 @@
 	cb->BufferSize.X = cb->Info.dwSize.X;
 	cb->BufferSize.Y = cb->Info.dwSize.Y;
 	NumCells = cb->BufferSize.X * cb->BufferSize.Y;
-	if (cb->Buffer != NULL)
-	    vim_free(cb->Buffer);
+	vim_free(cb->Buffer);
 	cb->Buffer = (PCHAR_INFO)alloc(NumCells * sizeof(CHAR_INFO));
 	if (cb->Buffer == NULL)
 	    return FALSE;

Raspunde prin e-mail lui