[gcc(refs/users/aoliva/heads/testbase)] libgcov: replace malloc and calloc.

Alexandre Oliva aoliva@gcc.gnu.org
Thu Jun 4 07:30:05 GMT 2020


https://gcc.gnu.org/g:a04b7410d305800b747963ab940d2b1a602b5ddf

commit a04b7410d305800b747963ab940d2b1a602b5ddf
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Jun 2 13:57:31 2020 +0200

    libgcov: replace malloc and calloc.
    
    The calloc was in the original tested version of the patch
    and I made accidental last minute change.
    
    Installed to master as obvious.
    
    libgcc/ChangeLog:
    
            * libgcov.h (gcov_topn_add_value): Use xcalloc instead
            of xmalloc.

Diff:
---
 libgcc/libgcov.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index bc38f4dd804..7c037a97878 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -443,7 +443,7 @@ gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count,
   else
     {
       struct gcov_kvp *new_node
-	= (struct gcov_kvp *)xmalloc (sizeof (struct gcov_kvp));
+	= (struct gcov_kvp *)xcalloc (1, sizeof (struct gcov_kvp));
       new_node->value = value;
       new_node->count = count;


More information about the Gcc-cvs mailing list