]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcov: replace malloc and calloc.
authorMartin Liska <mliska@suse.cz>
Tue, 2 Jun 2020 11:57:31 +0000 (13:57 +0200)
committerMartin Liska <mliska@suse.cz>
Tue, 2 Jun 2020 11:57:31 +0000 (13:57 +0200)
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.

libgcc/libgcov.h

index bc38f4dd80447f09a8b8cb791ed9896313595a85..7c037a978785efddd59edb29415de164100deb5e 100644 (file)
@@ -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;