diff src/term.c @ 95481:4390d64d3328

Make "xfree (NULL)" a no-op; remove useless if-before-xfree. * src/alloc.c (xfree): Return right away for a NULL arg. * src/lread.c (nosuffix): Remove now-useless if-before-xfree tests. * src/gtkutil.c (xg_gtk_scroll_destroy): Likewise. * src/mac.c (create_apple_event_from_event_ref): Likewise. (create_apple_event_from_drag_ref, cfstring_create_normalized): Likewise. * src/doprnt.c (doprnt1): Likewise. * src/frame.c (frame): Likewise. * src/keyboard.c (wipe_kboard): Likewise. * src/macterm.c (x_free_frame_resources, xlfdpat_destroy, XFreePixmap): (init_font_name_table, mac_unload_font, x_delete_display): Likewise. * src/term.c (tty_default_color_capabilities, maybe_fatal) (delete_tty): Likewise. * src/w16select.c (string): Likewise. * src/w32.c (w32_get_resource, SET_ENV_BUF_SIZE): Likewise. * src/w32bdf.c (w32_free_bdf_font): Likewise. * src/w32fns.c (w32_unload_font): Likewise. * src/w32font.c (w32font_close): Likewise. * src/window.c (size_window): Likewise. * src/xselect.c (receive_incremental_selection): Likewise. * src/xterm.c (x_free_frame_resources, x_delete_display): Likewise. * src/mactoolbox.c (create_apple_event_from_drag_ref): Likewise. * src/w32.c (stat): Likewise.
author Jim Meyering <jim@meyering.net>
date Mon, 02 Jun 2008 06:09:17 +0000
parents 8971ddf55736
children ddedcecb18ef
line wrap: on
line diff
--- a/src/term.c	Mon Jun 02 06:02:30 2008 +0000
+++ b/src/term.c	Mon Jun 02 06:09:17 2008 +0000
@@ -2090,17 +2090,14 @@
 
   if (save)
     {
-      if (default_orig_pair)
-	xfree (default_orig_pair);
+      xfree (default_orig_pair);
       default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL;
 
-      if (default_set_foreground)
-	xfree (default_set_foreground);
+      xfree (default_set_foreground);
       default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground)
 			       : NULL;
 
-      if (default_set_background)
-	xfree (default_set_background);
+      xfree (default_set_background);
       default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background)
 			       : NULL;
 
@@ -3833,8 +3830,7 @@
      struct terminal *terminal;
      char *str1, *str2, *arg1, *arg2;
 {
-  if (buffer)
-    xfree (buffer);
+  xfree (buffer);
 
   if (terminal)
     delete_tty (terminal);
@@ -3915,11 +3911,8 @@
 
   delete_terminal (terminal);
 
-  if (tty->name)
-    xfree (tty->name);
-
-  if (tty->type)
-    xfree (tty->type);
+  xfree (tty->name);
+  xfree (tty->type);
 
   if (tty->input)
     {
@@ -3932,11 +3925,8 @@
   if (tty->termscript)
     fclose (tty->termscript);
 
-  if (tty->old_tty)
-    xfree (tty->old_tty);
-
-  if (tty->Wcm)
-    xfree (tty->Wcm);
+  xfree (tty->old_tty);
+  xfree (tty->Wcm);
 
   bzero (tty, sizeof (struct tty_display_info));
   xfree (tty);