summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/media.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/media.c b/src/media.c
index 099e77e..f443d0c 100644
--- a/src/media.c
+++ b/src/media.c
@@ -410,12 +410,11 @@ struct media_device *media_open(const char *name, int verbose)
struct media_device *media;
int ret;
- media = malloc(sizeof(*media));
+ media = calloc(1, sizeof(*media));
if (media == NULL) {
printf("%s: unable to allocate memory\n", __func__);
return NULL;
}
- memset(media, 0, sizeof(*media));
if (verbose)
printf("Opening media device %s\n", name);