osmo_mdns_rfc_record_decode: check ret of talloc

Related: OS#5821
Change-Id: Icd0f54a8eb80ca50976f248e017f6e5c727385f3
changes/75/30775/1
Oliver Smith 2022-12-23 12:51:31 +01:00
parent e4143234c8
commit 01155eaee6
1 changed files with 5 additions and 1 deletions

View File

@ -237,9 +237,13 @@ int osmo_mdns_rfc_record_encode(void *ctx, struct msgb *msg, const struct osmo_m
struct osmo_mdns_rfc_record *osmo_mdns_rfc_record_decode(void *ctx, const uint8_t *data, size_t data_len,
size_t *record_len)
{
struct osmo_mdns_rfc_record *ret = talloc_zero(ctx, struct osmo_mdns_rfc_record);
struct osmo_mdns_rfc_record *ret;
size_t name_len;
ret = talloc_zero(ctx, struct osmo_mdns_rfc_record);
if (!ret)
return NULL;
/* name */
ret->domain = osmo_mdns_rfc_qname_decode(ret, (const char *)data, data_len - 10);
if (!ret->domain)