From e426fd6171bd1b4d88bcf9669dc35ea6fc24e9c4 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sun, 12 Jan 2020 22:47:43 -0600 Subject: [PATCH] Fix cppcheck warning in rot_dummy.c --- dummy/rot_dummy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dummy/rot_dummy.c b/dummy/rot_dummy.c index 0bae65cf4..c8f13d106 100644 --- a/dummy/rot_dummy.c +++ b/dummy/rot_dummy.c @@ -53,17 +53,18 @@ static int dummy_rot_init(ROT *rot) { struct dummy_rot_priv_data *priv; - priv = (struct dummy_rot_priv_data *) + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + rot->state.priv = (struct dummy_rot_priv_data *) malloc(sizeof(struct dummy_rot_priv_data)); - if (!priv) + if (!rot->state.priv) { return -RIG_ENOMEM; } - rot->state.priv = (void *)priv; + priv = rot->state.priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rot->state.rotport.type.rig = RIG_PORT_NONE; priv->az = priv->el = 0;