In qdist_bin__internal(), to->entries is initialized to a 1-element array,
which we then leak when n == from->n. Fix it.
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <
1469459025-23606-2-git-send-email-cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
}
}
/* they're equally spaced, so copy the dist and bail out */
- to->entries = g_new(struct qdist_entry, from->n);
+ to->entries = g_realloc_n(to->entries, n, sizeof(*to->entries));
to->n = from->n;
memcpy(to->entries, from->entries, sizeof(*to->entries) * to->n);
return;