From 3ec1cd707e9019b2a902436b639ba7a817ed0a23 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sun, 12 Jan 2020 22:51:31 -0600 Subject: [PATCH] Fix cppcheck warning in dttsp.c --- flexradio/dttsp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flexradio/dttsp.c b/flexradio/dttsp.c index 618099d08..bc36dcf7d 100644 --- a/flexradio/dttsp.c +++ b/flexradio/dttsp.c @@ -481,16 +481,16 @@ int dttsp_init(RIG *rig) const char *cmdpath; char *p; - priv = (struct dttsp_priv_data *)calloc(1, sizeof(struct dttsp_priv_data)); + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (!priv) + rig->state.priv = (struct dttsp_priv_data *)calloc(1, sizeof(struct dttsp_priv_data)); + + if (!rig->state.priv) { return -RIG_ENOMEM; } - rig->state.priv = (void *)priv; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + priv = rig->state.priv; priv->tuner = NULL; priv->tuner_model = RIG_MODEL_DUMMY;