osmo_mdns_rfc_record_decode: proper free on err

Free the whole talloc tree of ret if we can't allocate memory for
ret->rdata.

Related: OS#5821
Change-Id: Iefc89e3c75a4bf4ffee3871c7b551a2a608f7d5f
changes/76/30776/1
Oliver Smith 2022-12-23 12:53:12 +01:00
parent 01155eaee6
commit c5f034b13d
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ struct osmo_mdns_rfc_record *osmo_mdns_rfc_record_decode(void *ctx, const uint8_
/* rdata */
ret->rdata = talloc_memdup(ret, data + name_len + 10, ret->rdlength);
if (!ret->rdata)
return NULL;
goto error;
*record_len = name_len + 10 + ret->rdlength;
return ret;