[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r5571 - in /fsf/trunk/libc: ./ elf/ gmon/ iconv/ inet/ intl/ libidn/ libio/ locale/programs/ nis/nss_compat/ resolv/ sunrpc/...



Author: eglibc
Date: Wed Mar 19 00:04:01 2008
New Revision: 5571

Log:
Import glibc-mainline for 2008-03-19

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/ldconfig.c
    fsf/trunk/libc/gmon/gmon.c
    fsf/trunk/libc/iconv/gconv_conf.c
    fsf/trunk/libc/inet/rcmd.c
    fsf/trunk/libc/intl/bindtextdom.c
    fsf/trunk/libc/intl/loadmsgcat.c
    fsf/trunk/libc/libidn/ChangeLog
    fsf/trunk/libc/libidn/stringprep.c
    fsf/trunk/libc/libio/genops.c
    fsf/trunk/libc/libio/wgenops.c
    fsf/trunk/libc/locale/programs/ld-collate.c
    fsf/trunk/libc/locale/programs/linereader.c
    fsf/trunk/libc/nis/nss_compat/compat-pwd.c
    fsf/trunk/libc/nis/nss_compat/compat-spwd.c
    fsf/trunk/libc/resolv/res_debug.c
    fsf/trunk/libc/sunrpc/xdr_sizeof.c
    fsf/trunk/libc/sysdeps/mach/hurd/if_index.c
    fsf/trunk/libc/sysdeps/posix/sprofil.c
    fsf/trunk/libc/time/lc-time-cleanup.c
    fsf/trunk/libc/time/tzset.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Mar 19 00:04:01 2008
@@ -1,3 +1,25 @@
+2008-02-10  Jim Meyering  <meyering@xxxxxxxxxx>
+
+	Remove useless "if" before "free":
+	* elf/ldconfig.c (parse_conf_include): Likewise.
+	* gmon/gmon.c (weak_alias): Likewise.
+	* iconv/gconv_conf.c (__gconv_get_path): Likewise.
+	* inet/rcmd.c (__validuser2_sa): Likewise.
+	* intl/bindtextdom.c (set_binding_values): Likewise.
+	* intl/loadmsgcat.c (_nl_load_domain, _nl_unload_domain): Likewise.
+	* libio/genops.c (save_for_backup): Likewise.
+	* libio/wgenops.c (save_for_wbackup): Likewise.
+	* locale/programs/ld-collate.c (collate_read): Likewise.
+	* locale/programs/linereader.c (get_string): Likewise.
+	* nis/nss_compat/compat-pwd.c (give_pwd_free): Likewise.
+	* nis/nss_compat/compat-spwd.c (give_spwd_free): Likewise.
+	* resolv/res_debug.c (do_section): Likewise.
+	* sunrpc/xdr_sizeof.c (x_inline, xdr_sizeof): Likewise.
+	* sysdeps/mach/hurd/if_index.c (libc_hidden_def): Likewise.
+	* sysdeps/posix/sprofil.c (__sprofil): Likewise.
+	* time/lc-time-cleanup.c (_nl_cleanup_time): Likewise.
+	* time/tzset.c (tzset_internal): Likewise.
+
 2008-03-18  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/dl-sysdep.h: Use __ASSEMBLER__ instead

Modified: fsf/trunk/libc/elf/ldconfig.c
==============================================================================
--- fsf/trunk/libc/elf/ldconfig.c (original)
+++ fsf/trunk/libc/elf/ldconfig.c Wed Mar 19 00:04:01 2008
@@ -1184,8 +1184,7 @@
       break;
     }
 
-  if (copy)
-    free (copy);
+  free (copy);
 }
 
 /* Honour LD_HWCAP_MASK.  */

Modified: fsf/trunk/libc/gmon/gmon.c
==============================================================================
--- fsf/trunk/libc/gmon/gmon.c (original)
+++ fsf/trunk/libc/gmon/gmon.c Wed Mar 19 00:04:01 2008
@@ -396,6 +396,5 @@
     write_gmon ();
 
   /* free the memory. */
-  if (_gmonparam.tos != NULL)
-    free (_gmonparam.tos);
-}
+  free (_gmonparam.tos);
+}

Modified: fsf/trunk/libc/iconv/gconv_conf.c
==============================================================================
--- fsf/trunk/libc/iconv/gconv_conf.c (original)
+++ fsf/trunk/libc/iconv/gconv_conf.c Wed Mar 19 00:04:01 2008
@@ -529,8 +529,7 @@
 
       __gconv_path_elem = result ?: (struct path_elem *) &empty_path_elem;
 
-      if (cwd != NULL)
-	free (cwd);
+      free (cwd);
     }
 
   __libc_lock_unlock (lock);

Modified: fsf/trunk/libc/inet/rcmd.c
==============================================================================
--- fsf/trunk/libc/inet/rcmd.c (original)
+++ fsf/trunk/libc/inet/rcmd.c Wed Mar 19 00:04:01 2008
@@ -826,8 +826,7 @@
 	}
     }
 
-    if (buf != NULL)
-      free (buf);
+    free (buf);
 
     return retval;
 }

Modified: fsf/trunk/libc/intl/bindtextdom.c
==============================================================================
--- fsf/trunk/libc/intl/bindtextdom.c (original)
+++ fsf/trunk/libc/intl/bindtextdom.c Wed Mar 19 00:04:01 2008
@@ -203,8 +203,7 @@
 
 		  if (__builtin_expect (result != NULL, 1))
 		    {
-		      if (binding->codeset != NULL)
-			free (binding->codeset);
+		      free (binding->codeset);
 
 		      binding->codeset = result;
 		      modified = 1;

Modified: fsf/trunk/libc/intl/loadmsgcat.c
==============================================================================
--- fsf/trunk/libc/intl/loadmsgcat.c (original)
+++ fsf/trunk/libc/intl/loadmsgcat.c Wed Mar 19 00:04:01 2008
@@ -1236,8 +1236,7 @@
       /* This is an invalid revision.  */
     invalid:
       /* This is an invalid .mo file.  */
-      if (domain->malloced)
-	free (domain->malloced);
+      free (domain->malloced);
 #ifdef HAVE_MMAP
       if (use_mmap)
 	munmap ((caddr_t) data, size);
@@ -1289,12 +1288,10 @@
       if (convd->conv != (__gconv_t) -1)
 	__gconv_close (convd->conv);
     }
-  if (domain->conversions != NULL)
-    free (domain->conversions);
+  free (domain->conversions);
   __libc_rwlock_fini (domain->conversions_lock);
 
-  if (domain->malloced)
-    free (domain->malloced);
+  free (domain->malloced);
 
 # ifdef _POSIX_MAPPED_FILES
   if (domain->use_mmap)

Modified: fsf/trunk/libc/libidn/ChangeLog
==============================================================================
--- fsf/trunk/libc/libidn/ChangeLog (original)
+++ fsf/trunk/libc/libidn/ChangeLog Wed Mar 19 00:04:01 2008
@@ -1,3 +1,8 @@
+2008-02-10  Jim Meyering  <meyering@xxxxxxxxxx>
+
+	* stringprep.c (stringprep, stringprep_profile): Remove useless
+	"if" before "free".
+
 2006-02-27  Roland McGrath  <roland@xxxxxxxxxx>
 
 	* Makefile: Use $(..) in place of ../.

Modified: fsf/trunk/libc/libidn/stringprep.c
==============================================================================
--- fsf/trunk/libc/libidn/stringprep.c (original)
+++ fsf/trunk/libc/libidn/stringprep.c Wed Mar 19 00:04:01 2008
@@ -366,8 +366,7 @@
 
   do
     {
-      if (ucs4)
-	free (ucs4);
+      free (ucs4);
       ucs4 = stringprep_utf8_to_ucs4 (in, -1, &ucs4len);
       maxucs4len = ucs4len + adducs4len;
       uint32_t *newp = realloc (ucs4, maxucs4len * sizeof (uint32_t));
@@ -449,8 +448,7 @@
 
   do
     {
-      if (str)
-	free (str);
+      free (str);
       str = (char *) malloc (len);
       if (str == NULL)
 	return STRINGPREP_MALLOC_ERROR;

Modified: fsf/trunk/libc/libio/genops.c
==============================================================================
--- fsf/trunk/libc/libio/genops.c (original)
+++ fsf/trunk/libc/libio/genops.c Wed Mar 19 00:04:01 2008
@@ -300,8 +300,7 @@
 	memcpy (new_buffer + avail,
 		fp->_IO_read_base + least_mark,
 		needed_size);
-      if (fp->_IO_save_base)
-	free (fp->_IO_save_base);
+      free (fp->_IO_save_base);
       fp->_IO_save_base = new_buffer;
       fp->_IO_save_end = new_buffer + avail + needed_size;
     }

Modified: fsf/trunk/libc/libio/wgenops.c
==============================================================================
--- fsf/trunk/libc/libio/wgenops.c (original)
+++ fsf/trunk/libc/libio/wgenops.c Wed Mar 19 00:04:01 2008
@@ -553,8 +553,7 @@
 		  needed_size * sizeof (wchar_t));
 #endif
 	}
-      if (fp->_wide_data->_IO_save_base)
-	free (fp->_wide_data->_IO_save_base);
+      free (fp->_wide_data->_IO_save_base);
       fp->_wide_data->_IO_save_base = new_buffer;
       fp->_wide_data->_IO_save_end = new_buffer + avail + needed_size;
     }

Modified: fsf/trunk/libc/locale/programs/ld-collate.c
==============================================================================
--- fsf/trunk/libc/locale/programs/ld-collate.c (original)
+++ fsf/trunk/libc/locale/programs/ld-collate.c Wed Mar 19 00:04:01 2008
@@ -2963,10 +2963,8 @@
 		col_elem_free:
 		  if (symbol != NULL)
 		    free ((char *) symbol);
-		  if (arg->val.str.startmb != NULL)
-		    free (arg->val.str.startmb);
-		  if (arg->val.str.startwc != NULL)
-		    free (arg->val.str.startwc);
+		  free (arg->val.str.startmb);
+		  free (arg->val.str.startwc);
 		}
 	      lr_ignore_rest (ldfile, 1);
 	    }
@@ -3112,10 +3110,8 @@
 	      else
 		{
 		col_sym_free:
-		  if (symbol != NULL)
-		    free (symbol);
-		  if (endsymbol != NULL)
-		    free (endsymbol);
+		  free (symbol);
+		  free (endsymbol);
 		}
 	    }
 	  break;

Modified: fsf/trunk/libc/locale/programs/linereader.c
==============================================================================
--- fsf/trunk/libc/locale/programs/linereader.c (original)
+++ fsf/trunk/libc/locale/programs/linereader.c Wed Mar 19 00:04:01 2008
@@ -859,8 +859,7 @@
       if (illegal_string)
 	{
 	  free (buf);
-	  if (buf2 != NULL)
-	    free (buf2);
+	  free (buf2);
 	  lr->token.val.str.startmb = NULL;
 	  lr->token.val.str.lenmb = 0;
 	  lr->token.val.str.startwc = NULL;

Modified: fsf/trunk/libc/nis/nss_compat/compat-pwd.c
==============================================================================
--- fsf/trunk/libc/nis/nss_compat/compat-pwd.c (original)
+++ fsf/trunk/libc/nis/nss_compat/compat-pwd.c Wed Mar 19 00:04:01 2008
@@ -116,16 +116,11 @@
 static void
 give_pwd_free (struct passwd *pwd)
 {
-  if (pwd->pw_name != NULL)
-    free (pwd->pw_name);
-  if (pwd->pw_passwd != NULL)
-    free (pwd->pw_passwd);
-  if (pwd->pw_gecos != NULL)
-    free (pwd->pw_gecos);
-  if (pwd->pw_dir != NULL)
-    free (pwd->pw_dir);
-  if (pwd->pw_shell != NULL)
-    free (pwd->pw_shell);
+  free (pwd->pw_name);
+  free (pwd->pw_passwd);
+  free (pwd->pw_gecos);
+  free (pwd->pw_dir);
+  free (pwd->pw_shell);
 
   memset (pwd, '\0', sizeof (struct passwd));
 }

Modified: fsf/trunk/libc/nis/nss_compat/compat-spwd.c
==============================================================================
--- fsf/trunk/libc/nis/nss_compat/compat-spwd.c (original)
+++ fsf/trunk/libc/nis/nss_compat/compat-spwd.c Wed Mar 19 00:04:01 2008
@@ -113,10 +113,8 @@
 static void
 give_spwd_free (struct spwd *pwd)
 {
-  if (pwd->sp_namp != NULL)
-    free (pwd->sp_namp);
-  if (pwd->sp_pwdp != NULL)
-    free (pwd->sp_pwdp);
+  free (pwd->sp_namp);
+  free (pwd->sp_pwdp);
 
   memset (pwd, '\0', sizeof (struct spwd));
   pwd->sp_warn = -1;

Modified: fsf/trunk/libc/resolv/res_debug.c
==============================================================================
--- fsf/trunk/libc/resolv/res_debug.c (original)
+++ fsf/trunk/libc/resolv/res_debug.c Wed Mar 19 00:04:01 2008
@@ -204,8 +204,7 @@
 		rrnum++;
 	}
  cleanup:
-	if (buf != NULL)
-		free(buf);
+	free(buf);
 }
 
 /*

Modified: fsf/trunk/libc/sunrpc/xdr_sizeof.c
==============================================================================
--- fsf/trunk/libc/sunrpc/xdr_sizeof.c (original)
+++ fsf/trunk/libc/sunrpc/xdr_sizeof.c Wed Mar 19 00:04:01 2008
@@ -86,8 +86,7 @@
   else
     {
       /* Free the earlier space and allocate new area */
-      if (xdrs->x_private)
-	free (xdrs->x_private);
+      free (xdrs->x_private);
       if ((xdrs->x_private = (caddr_t) malloc (len)) == NULL)
 	{
 	  xdrs->x_base = 0;
@@ -157,7 +156,6 @@
   x.x_base = (caddr_t) 0;
 
   stat = func (&x, data);
-  if (x.x_private)
-    free (x.x_private);
+  free (x.x_private);
   return stat == TRUE ? x.x_handy : 0;
 }

Modified: fsf/trunk/libc/sysdeps/mach/hurd/if_index.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/if_index.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/if_index.c Wed Mar 19 00:04:01 2008
@@ -59,8 +59,7 @@
   struct if_nameindex *ptr = ifn;
   while (ptr->if_name || ptr->if_index)
     {
-      if (ptr->if_name)
-        free (ptr->if_name);
+      free (ptr->if_name);
       ++ptr;
     }
   free (ifn);

Modified: fsf/trunk/libc/sysdeps/posix/sprofil.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/sprofil.c (original)
+++ fsf/trunk/libc/sysdeps/posix/sprofil.c Wed Mar 19 00:04:01 2008
@@ -322,8 +322,7 @@
   for (i = 0; i < profcnt; ++i)
     if (add_region (p[i], (flags & PROF_UINT) != 0) < 0)
       {
-	if (prof_info.region)
-	  free (prof_info.region);
+	free (prof_info.region);
 	prof_info.num_regions = 0;
 	prof_info.region = NULL;
 	return -1;

Modified: fsf/trunk/libc/time/lc-time-cleanup.c
==============================================================================
--- fsf/trunk/libc/time/lc-time-cleanup.c (original)
+++ fsf/trunk/libc/time/lc-time-cleanup.c Wed Mar 19 00:04:01 2008
@@ -29,12 +29,9 @@
       locale->private.time = NULL;
       locale->private.cleanup = NULL;
 
-      if (data->eras != NULL)
-	free (data->eras);
-      if (data->alt_digits != NULL)
-	free (data->alt_digits);
-      if (data->walt_digits != NULL)
-	free (data->walt_digits);
+      free (data->eras);
+      free (data->alt_digits);
+      free (data->walt_digits);
 
       free (data);
     }

Modified: fsf/trunk/libc/time/tzset.c
==============================================================================
--- fsf/trunk/libc/time/tzset.c (original)
+++ fsf/trunk/libc/time/tzset.c Wed Mar 19 00:04:01 2008
@@ -414,8 +414,7 @@
   tz_rules[1].name = NULL;
 
   /* Save the value of `tz'.  */
-  if (old_tz != NULL)
-    free (old_tz);
+  free (old_tz);
   old_tz = tz ? __strdup (tz) : NULL;
 
   /* Try to read a data file.  */