* somsolib.c (som_solib_add): Use xmalloc rather than bare
authorFred Fish <fnf@specifix.com>
Mon, 12 Feb 1996 22:13:18 +0000 (22:13 +0000)
committerFred Fish <fnf@specifix.com>
Mon, 12 Feb 1996 22:13:18 +0000 (22:13 +0000)
unchecked call to malloc.
* remote-mips.c (pmon_load_fast): ditto.
* remote-mm.c (mm_open): ditto.
* hpread.c (hpread_lookup_type): ditto.
* remote-adapt.c (adapt_open): ditto.

gdb/ChangeLog
gdb/hpread.c
gdb/remote-adapt.c
gdb/remote-mips.c
gdb/remote-mm.c
gdb/somsolib.c

index 505166d..6eb9d9b 100644 (file)
@@ -1,3 +1,12 @@
+Mon Feb 12 14:17:52 1996  Fred Fish  <fnf@cygnus.com>
+
+       * somsolib.c (som_solib_add): Use xmalloc rather than bare
+       unchecked call to malloc.
+       * remote-mips.c (pmon_load_fast): ditto.
+       * remote-mm.c (mm_open): ditto.
+       * hpread.c (hpread_lookup_type): ditto.
+       * remote-adapt.c (adapt_open): ditto.
+
 Mon Feb 12 13:11:32 1996  Fred Fish  <fnf@cygnus.com>
 
        * f-lang.c (allocate_saved_bf_node, allocate_saved_function_node,
index 2463f13..c8fbec0 100644 (file)
@@ -1215,7 +1215,7 @@ hpread_lookup_type (hp_type, objfile)
            {
              TYPE_VECTOR_LENGTH (objfile) = 100;
              TYPE_VECTOR (objfile) = (struct type **)
-               malloc (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
+               xmalloc (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
            }
          while (index >= TYPE_VECTOR_LENGTH (objfile))
            TYPE_VECTOR_LENGTH (objfile) *= 2;
index a3110ef..8fcb1f7 100644 (file)
@@ -484,7 +484,7 @@ erroid:
     error ("\
 Please include the name of the device for the serial port,\n\
 the baud rate, and the name of the program to run on the remote system.");
-  dev_name = (char*)malloc(p - name + 1);
+  dev_name = (char*)xmalloc(p - name + 1);
   strncpy (dev_name, name, p - name);
   dev_name[p - name] = '\0';
 
index 68d61b7..27bcf86 100644 (file)
@@ -2705,8 +2705,8 @@ pmon_load_fast (file)
   int final;
   int finished = 0;
 
-  buffer = (char *)malloc(MAXRECSIZE + 1);
-  binbuf = (unsigned char *)malloc(BINCHUNK);
+  buffer = (char *)xmalloc(MAXRECSIZE + 1);
+  binbuf = (unsigned char *)xmalloc(BINCHUNK);
 
   abfd = bfd_openr(file,0);
   if (!abfd)
index 360aa9d..101d964 100644 (file)
@@ -260,7 +260,7 @@ mm_open (name, from_tty)
   if (p == 0 || *p == '\0')
 erroid:
     error ("Usage : <command> <serial-device> <baud-rate> [progname]");
-  dev_name = (char*)malloc (p - name + 1);
+  dev_name = (char*)xmalloc (p - name + 1);
   strncpy (dev_name, name, p - name);
   dev_name[p - name] = '\0';
 
index 2d232b3..ebec205 100644 (file)
@@ -301,7 +301,7 @@ som_solib_add (arg_string, from_tty, target)
       text_addr = extract_unsigned_integer (buf, 4);
 
 
-      new_so = (struct so_list *) malloc (sizeof (struct so_list));
+      new_so = (struct so_list *) xmalloc (sizeof (struct so_list));
       memset ((char *)new_so, 0, sizeof (struct so_list));
       if (so_list_head == NULL)
        {