kopia lustrzana https://github.com/Hamlib/Hamlib
Change malloc to calloc
rodzic
027b3ee0a5
commit
dd3208ad34
|
@ -56,7 +56,7 @@ static int dummy_amp_init(AMP *amp)
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||||
|
|
||||||
amp->state.priv = (struct dummy_amp_priv_data *)
|
amp->state.priv = (struct dummy_amp_priv_data *)
|
||||||
malloc(sizeof(struct dummy_amp_priv_data));
|
calloc(1,sizeof(struct dummy_amp_priv_data));
|
||||||
|
|
||||||
if (!amp->state.priv)
|
if (!amp->state.priv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -613,7 +613,7 @@ static int flrig_init(RIG *rig)
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
|
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
|
||||||
|
|
||||||
rig->state.priv = (struct flrig_priv_data *)malloc(sizeof(
|
rig->state.priv = (struct flrig_priv_data *)calloc(1,sizeof(
|
||||||
struct flrig_priv_data));
|
struct flrig_priv_data));
|
||||||
|
|
||||||
if (!rig->state.priv)
|
if (!rig->state.priv)
|
||||||
|
|
|
@ -168,7 +168,7 @@ static int netrigctl_init(RIG *rig)
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rig->state.priv = (struct netrigctl_priv_data *)malloc(sizeof(
|
rig->state.priv = (struct netrigctl_priv_data *)calloc(1,sizeof(
|
||||||
struct netrigctl_priv_data));
|
struct netrigctl_priv_data));
|
||||||
|
|
||||||
if (!rig->state.priv)
|
if (!rig->state.priv)
|
||||||
|
@ -2387,7 +2387,7 @@ static int netrigctl_send_dtmf(RIG *rig, vfo_t vfo, const char *digits)
|
||||||
|
|
||||||
// allocate memory for size of (cmd + digits + \n + \0)
|
// allocate memory for size of (cmd + digits + \n + \0)
|
||||||
len = strlen(cmd) + strlen(digits) + 2;
|
len = strlen(cmd) + strlen(digits) + 2;
|
||||||
cmdp = malloc(len);
|
cmdp = calloc(1,len);
|
||||||
|
|
||||||
if (cmdp == NULL)
|
if (cmdp == NULL)
|
||||||
{
|
{
|
||||||
|
@ -2470,7 +2470,7 @@ static int netrigctl_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
||||||
|
|
||||||
// allocate memory for size of (cmd + msg + \n + \0)
|
// allocate memory for size of (cmd + msg + \n + \0)
|
||||||
len = strlen(cmd) + strlen(msg) + 2;
|
len = strlen(cmd) + strlen(msg) + 2;
|
||||||
cmdp = malloc(len);
|
cmdp = calloc(1,len);
|
||||||
|
|
||||||
if (cmdp == NULL)
|
if (cmdp == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,7 +121,7 @@ static int dummy_rot_init(ROT *rot)
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||||
|
|
||||||
rot->state.priv = (struct dummy_rot_priv_data *)
|
rot->state.priv = (struct dummy_rot_priv_data *)
|
||||||
malloc(sizeof(struct dummy_rot_priv_data));
|
calloc(1,sizeof(struct dummy_rot_priv_data));
|
||||||
|
|
||||||
if (!rot->state.priv)
|
if (!rot->state.priv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -424,7 +424,7 @@ static int tci1x_init(RIG *rig)
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
|
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
|
||||||
|
|
||||||
rig->state.priv = (struct tci1x_priv_data *)malloc(sizeof(
|
rig->state.priv = (struct tci1x_priv_data *)calloc(1,sizeof(
|
||||||
struct tci1x_priv_data));
|
struct tci1x_priv_data));
|
||||||
|
|
||||||
if (!rig->state.priv)
|
if (!rig->state.priv)
|
||||||
|
|
|
@ -262,7 +262,7 @@ static int trxmanager_init(RIG *rig)
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, BACKEND_VER);
|
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, BACKEND_VER);
|
||||||
|
|
||||||
rig->state.priv = (struct trxmanager_priv_data *)malloc(
|
rig->state.priv = (struct trxmanager_priv_data *)calloc(1,
|
||||||
sizeof(struct trxmanager_priv_data));
|
sizeof(struct trxmanager_priv_data));
|
||||||
|
|
||||||
if (!rig->state.priv)
|
if (!rig->state.priv)
|
||||||
|
|
Ładowanie…
Reference in New Issue