Free the error string returned by str_to_u8() in set_tunnel_config().
While at it, also add a proper error message for this error case.
Fixes: ebe0e518b048 ("tunnel: Bareudp Tunnel Support.")
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
tnl_cfg.exts |= (1 << OVS_BAREUDP_EXT_MULTIPROTO_MODE);
} else {
uint16_t payload_ethertype;
+ char *error = str_to_u16(node->value, "payload_type",
+ &payload_ethertype);
- if (str_to_u16(node->value, "payload_type",
- &payload_ethertype)) {
+ if (error) {
+ free(error);
+ ds_put_format(&errors, "%s: bad %s 'payload_type'\n",
+ name, node->value);
err = EINVAL;
goto out;
}