diff mbox

[PULL,11/25] qdist: use g_realloc_n instead of g_realloc

Message ID 1470166775-3671-12-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Aug. 2, 2016, 7:39 p.m. UTC
From: "Emilio G. Cota" <cota@braap.org>

While at it, remove the unnecessary parentheses around dist->size.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1469459025-23606-3-git-send-email-cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 util/qdist.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/util/qdist.c b/util/qdist.c
index eb2236c..cc31140 100644
--- a/util/qdist.c
+++ b/util/qdist.c
@@ -62,8 +62,8 @@  void qdist_add(struct qdist *dist, double x, long count)
 
     if (unlikely(dist->n == dist->size)) {
         dist->size *= 2;
-        dist->entries = g_realloc(dist->entries,
-                                  sizeof(*dist->entries) * (dist->size));
+        dist->entries = g_realloc_n(dist->entries, dist->size,
+                                    sizeof(*dist->entries));
     }
     dist->n++;
     entry = &dist->entries[dist->n - 1];