* varobj.c (varobj_set_display_format): Use xfree.
authorTom Tromey <tromey@redhat.com>
Sat, 13 Sep 2008 23:37:05 +0000 (23:37 +0000)
committerTom Tromey <tromey@redhat.com>
Sat, 13 Sep 2008 23:37:05 +0000 (23:37 +0000)
* tracepoint.c (stringify_collection_list): Use xfree.
* remote-fileio.c (remote_fileio_reset): Use xfree.
* mipsread.c (read_alphacoff_dynamic_symtab): Use xfree.
* dfp.c (decimal_from_floating): Use xfree, xstrprintf.  Don't use
asprintf.
* cp-support.c (mangled_name_to_comp): Use xfree.

gdb/ChangeLog
gdb/cp-support.c
gdb/dfp.c
gdb/mipsread.c
gdb/remote-fileio.c
gdb/tracepoint.c
gdb/varobj.c

index bd96697d688ba29a037c2bdb3de05f7378bd6311..897c3acf14726b7720633692b6c1302e191ebc3b 100644 (file)
@@ -1,3 +1,13 @@
+2008-09-13  Tom Tromey  <tromey@redhat.com>
+
+       * varobj.c (varobj_set_display_format): Use xfree.
+       * tracepoint.c (stringify_collection_list): Use xfree.
+       * remote-fileio.c (remote_fileio_reset): Use xfree.
+       * mipsread.c (read_alphacoff_dynamic_symtab): Use xfree.
+       * dfp.c (decimal_from_floating): Use xfree, xstrprintf.  Don't use
+       asprintf.
+       * cp-support.c (mangled_name_to_comp): Use xfree.
+
 2008-09-13  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-lang.c (remove_extra_symbols): Remove stub symbols if
index df48f6021db212917b8ccb7439779b37570c8b90..f50d8fd44360ede22334bd89c389087aa7979e1f 100644 (file)
@@ -167,7 +167,7 @@ mangled_name_to_comp (const char *mangled_name, int options,
 
   if (ret == NULL)
     {
-      free (demangled_name);
+      xfree (demangled_name);
       return NULL;
     }
 
index 9816d272e89bf8350737b5f9346d5d20bf5a8ea0..bbaf9aa6c55d27c5ad012dd0f40b5a586e19e2b2 100644 (file)
--- a/gdb/dfp.c
+++ b/gdb/dfp.c
@@ -235,16 +235,12 @@ void
 decimal_from_floating (struct value *from, gdb_byte *to, int len)
 {
   char *buffer;
-  int ret;
 
-  ret = asprintf (&buffer, "%.30" DOUBLEST_PRINT_FORMAT,
-                 value_as_double (from));
-  if (ret < 0)
-    error (_("Error in memory allocation for conversion to decimal float."));
+  buffer = xstrprintf ("%.30" DOUBLEST_PRINT_FORMAT, value_as_double (from));
 
   decimal_from_string (to, len, buffer);
 
-  free (buffer);
+  xfree (buffer);
 }
 
 /* Converts a decimal float of LEN bytes to a double value.  */
index fdd8634472e8e0137dfb5b4273eb84ac6ab23612..1e88f815027438693140b6b42d53b53067bf448f 100644 (file)
@@ -217,13 +217,13 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets,
   dyninfo_secsize = bfd_get_section_size (si.dyninfo_sect);
   got_secsize = bfd_get_section_size (si.got_sect);
   sym_secptr = xmalloc (sym_secsize);
-  cleanups = make_cleanup (free, sym_secptr);
+  cleanups = make_cleanup (xfree, sym_secptr);
   str_secptr = xmalloc (str_secsize);
-  make_cleanup (free, str_secptr);
+  make_cleanup (xfree, str_secptr);
   dyninfo_secptr = xmalloc (dyninfo_secsize);
-  make_cleanup (free, dyninfo_secptr);
+  make_cleanup (xfree, dyninfo_secptr);
   got_secptr = xmalloc (got_secsize);
-  make_cleanup (free, got_secptr);
+  make_cleanup (xfree, got_secptr);
 
   if (!bfd_get_section_contents (abfd, si.sym_sect, sym_secptr,
                                 (file_ptr) 0, sym_secsize))
index 93665c9fb4565338c14d7251a53591f1a0c2d4b1..05a78becdac00cf5709cd587a16fd8d89c1bfb5f 100644 (file)
@@ -1398,7 +1398,7 @@ remote_fileio_reset (void)
     }
   if (remote_fio_data.fd_map)
     {
-      free (remote_fio_data.fd_map);
+      xfree (remote_fio_data.fd_map);
       remote_fio_data.fd_map = NULL;
       remote_fio_data.fd_map_size = 0;
     }
index 690eba3104502adb2605a4fc8f276046cc4ff1c2..4f5c56a66a48fe8d6f512174cd8f54c7a969bcf4 100644 (file)
@@ -1452,7 +1452,7 @@ stringify_collection_list (struct collection_list *list, char *string)
 
   if (ndx == 0)
     {
-      free (str_list);
+      xfree (str_list);
       return NULL;
     }
   else
index 35d876ff09229241944ccf291cb9882966113fa0..5b44eef0d82cce5269d40c5645f8d1cae9fe1715 100644 (file)
@@ -693,7 +693,7 @@ varobj_set_display_format (struct varobj *var,
   if (varobj_value_is_changeable_p (var) 
       && var->value && !value_lazy (var->value))
     {
-      free (var->print_value);
+      xfree (var->print_value);
       var->print_value = value_get_print_value (var->value, var->format);
     }
 
This page took 0.033036 seconds and 4 git commands to generate.