Fix potential segfault in g313-posix.c

This commit is contained in:
Michael Black 2019-12-24 12:55:01 -06:00
parent 73e6ae44bd
commit 4f05f09eed
No known key found for this signature in database
GPG Key ID: 6599353EC683404D

View File

@ -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)