gprs_ns2: allow to use free_vc() with NULL

Usually talloc_free() and other free functions in osmocom allows
to be called with NULL which is then ignored.

Change-Id: If7b0c6916a29d4611d0a40c388414076eb83e6b5
This commit is contained in:
Alexander Couzens 2021-01-17 16:51:55 +01:00
parent 55bc86931e
commit ea37724b3c
2 changed files with 5 additions and 1 deletions

View File

@ -101,7 +101,8 @@ struct priv_vc {
static void free_vc(struct gprs_ns2_vc *nsvc)
{
OSMO_ASSERT(nsvc);
if (!nsvc)
return;
if (!nsvc->priv)
return;

View File

@ -73,6 +73,9 @@ static void free_bind(struct gprs_ns2_vc_bind *bind)
static void free_vc(struct gprs_ns2_vc *nsvc)
{
if (!nsvc)
return;
if (!nsvc->priv)
return;