kopia lustrzana https://github.com/Hamlib/Hamlib
Fix potential segfault in g313-posix.c
rodzic
73e6ae44bd
commit
4f05f09eed
|
@ -115,14 +115,14 @@ int g313_init(RIG *rig)
|
||||||
|
|
||||||
priv = (struct g313_priv_data *)malloc(sizeof(struct g313_priv_data));
|
priv = (struct g313_priv_data *)malloc(sizeof(struct g313_priv_data));
|
||||||
|
|
||||||
memset(priv, 0, sizeof(struct g313_priv_data));
|
|
||||||
|
|
||||||
if (!priv)
|
if (!priv)
|
||||||
{
|
{
|
||||||
/* whoops! memory shortage! */
|
/* whoops! memory shortage! */
|
||||||
return -RIG_ENOMEM;
|
return -RIG_ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(priv, 0, sizeof(struct g313_priv_data));
|
||||||
|
|
||||||
priv->hWRAPI = g313_init_api();
|
priv->hWRAPI = g313_init_api();
|
||||||
|
|
||||||
if (priv->hWRAPI)
|
if (priv->hWRAPI)
|
||||||
|
|
Ładowanie…
Reference in New Issue