NS2: follow the change of ownership

When receiving a primitive from the NS2 layer
the PCU must free the msg buffer if given.

Change-Id: I180433735bfbb3375c41318d7a7709d5845199ba
This commit is contained in:
Alexander Couzens 2020-10-26 00:33:31 +01:00 committed by lynxis lazus
parent 2c1fed20ab
commit a2848546d2
1 changed files with 5 additions and 1 deletions

View File

@ -597,7 +597,7 @@ int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
LOGP(DPCU, LOGL_NOTICE, "NS: %s Unknown prim %d from NS\n",
get_value_string(osmo_prim_op_names, oph->operation),
oph->operation);
return 0;
goto out;
}
switch (oph->primitive) {
@ -620,6 +620,10 @@ int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
break;
}
out:
if (oph->msg)
msgb_free(oph->msg);
return rc;
}