Fix valgrind warning uninitialized value in dummy.c for priv->split

pull/1095/head
Mike Black W9MDB 2022-07-27 10:03:20 -05:00
rodzic 0c89bcd89f
commit 027b3ee0a5
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -222,7 +222,7 @@ static int dummy_init(RIG *rig)
int i;
ENTERFUNC;
priv = (struct dummy_priv_data *)malloc(sizeof(struct dummy_priv_data));
priv = (struct dummy_priv_data *)calloc(1,sizeof(struct dummy_priv_data));
if (!priv)
{
@ -234,6 +234,7 @@ static int dummy_init(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig->state.rigport.type.rig = RIG_PORT_NONE;
priv->split = RIG_SPLIT_OFF;
priv->ptt = RIG_PTT_OFF;
priv->powerstat = RIG_POWER_ON;
rig->state.powerstat = priv->powerstat;
@ -416,6 +417,12 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
ENTERFUNC;
if (rig == NULL)
{
rig_debug(RIG_DEBUG_ERR, "%s: rig is NULL!!!\n", __func__);
return -RIG_EINVAL;
}
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
// if needed for testing enable this to emulate a rig with 100hz resolution

Wyświetl plik

@ -548,6 +548,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
pthread_mutex_init(&rs->mutex_set_transaction, NULL);
#endif
rs->priv = NULL;
rs->async_data_enabled = 0;
rs->rigport.fd = -1;
rs->pttport.fd = -1;