bluez5: use reallocarray

This commit is contained in:
Wim Taymans 2022-04-27 09:27:32 +02:00
parent c0cf2d802b
commit 9e3b784b34

View file

@ -1579,7 +1579,7 @@ const struct a2dp_codec **spa_bt_device_get_supported_a2dp_codecs(struct spa_bt_
if (j >= size) {
const struct a2dp_codec **p;
size = size * 2;
p = realloc(supported_codecs, size * sizeof(const struct a2dp_codec *));
p = reallocarray(supported_codecs, size, sizeof(const struct a2dp_codec *));
if (p == NULL) {
free(supported_codecs);
return NULL;