diff options
-rw-r--r-- | src/mediactl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mediactl.c b/src/mediactl.c index 14cff30..46562de 100644 --- a/src/mediactl.c +++ b/src/mediactl.c @@ -206,8 +206,8 @@ static int media_enum_links(struct media_device *media) unsigned int i; links.entity = entity->info.id; - links.pads = malloc(entity->info.pads * sizeof(struct media_pad_desc)); - links.links = malloc(entity->info.links * sizeof(struct media_link_desc)); + links.pads = calloc(entity->info.pads, sizeof(struct media_pad_desc)); + links.links = calloc(entity->info.links, sizeof(struct media_link_desc)); if (ioctl(media->fd, MEDIA_IOC_ENUM_LINKS, &links) < 0) { media_dbg(media, |