Use XCNEWVAR instead of xcalloc
authorJanne Blomqvist <jb@gcc.gnu.org>
Tue, 19 Apr 2011 18:18:08 +0000 (21:18 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Tue, 19 Apr 2011 18:18:08 +0000 (21:18 +0300)
From-SVN: r172730

gcc/fortran/ChangeLog
gcc/fortran/scanner.c

index b4dabb46ac88ca99130f701643ab82c3d527b978..ca02edfa7b58f6ca3025f769385b96de33a4c929 100644 (file)
@@ -1,3 +1,7 @@
+2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * scanner.c (load_file): Use XCNEWVAR instead of xcalloc.
+
 2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * frontend-passes.c (gfc_run_passes): Use XDELETEVEC instead of
index f99429a7cc0beab4c7d86f9ca055b86d36689ae8..0c127d49e02d434886daabdc07c136bb2a9ec406 100644 (file)
@@ -2012,8 +2012,8 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
 
       /* Add line.  */
 
-      b = (gfc_linebuf *) xcalloc (1, gfc_linebuf_header_size
-                                  + (len + 1) * sizeof (gfc_char_t));
+      b = XCNEWVAR (gfc_linebuf, gfc_linebuf_header_size
+                   + (len + 1) * sizeof (gfc_char_t));
 
       b->location
        = linemap_line_start (line_table, current_file->line++, 120);