From 33837f0382aff50eda6dfb0662e18c2fab60538b Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 20 Jan 2022 20:14:02 +0100 Subject: [PATCH] [mpd] Coverity fixups --- src/mpd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mpd.c b/src/mpd.c index add34da8..58929e8d 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -811,7 +811,8 @@ parse_group_params(int argc, char **argv, bool group_in_listcommand, struct quer return 0; *groupsize = (argc - first_group) / 2; - *group = calloc(*groupsize, sizeof(struct mpd_tagtype *)); + + CHECK_NULL(L_MPD, *group = calloc(*groupsize, sizeof(struct mpd_tagtype *))); // Now process all group/field arguments for (j = 0; j < (*groupsize); j++) @@ -3557,7 +3558,7 @@ output_get_cb(struct player_speaker_info *spk, void *arg) if (!param->output && param->shortid == (unsigned short) spk->id) { - param->output = calloc(1, sizeof(struct output)); + CHECK_NULL(L_MPD, param->output = calloc(1, sizeof(struct output))); param->output->id = spk->id; param->output->shortid = (unsigned short) spk->id;