Add assert for link check to osmo_stream_srv_create()

We implicitly rely on conn->srv availability in several functions.
Let's ensure it's available in function creating conn.

Change-Id: If494eac5dcce6c5ae30e928b92e57067d5681a42
This commit is contained in:
Max 2022-11-18 21:27:08 +03:00 committed by laforge
parent 3d13c2bb42
commit a6db89089e
1 changed files with 2 additions and 0 deletions

View File

@ -1377,6 +1377,8 @@ osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link,
{
struct osmo_stream_srv *conn;
OSMO_ASSERT(link);
conn = talloc_zero(ctx, struct osmo_stream_srv);
if (conn == NULL) {
LOGP(DLINP, LOGL_ERROR, "cannot allocate new peer in srv, "