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
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 413408d..671629b 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -597,7 +597,7 @@
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 @@
break;
}
+out:
+ if (oph->msg)
+ msgb_free(oph->msg);
+
return rc;
}