# HG changeset patch # User reimar # Date 1382731197 0 # Node ID 3961f6dd9dff231ee1d6fa2e82df79023e390d5c # Parent 542cf5882264dc9cc77a38b3c1e80479b9363cb0 Use sizeof(*var) instead of sizeof(type), prefer calloc. diff -r 542cf5882264 -r 3961f6dd9dff libmpcodecs/ad_mpg123.c --- a/libmpcodecs/ad_mpg123.c Fri Oct 25 19:59:56 2013 +0000 +++ b/libmpcodecs/ad_mpg123.c Fri Oct 25 19:59:57 2013 +0000 @@ -84,8 +84,7 @@ if (mpg123_init() != MPG123_OK) return 0; - sh->context = malloc(sizeof(struct ad_mpg123_context)); - con = sh->context; + sh->context = con = calloc(sizeof(*con), 1); /* Auto-choice of optimized decoder (first argument NULL). */ con->handle = mpg123_new(NULL, &err); if (!con->handle)