TSG-15278 bugfix: memleak

This commit is contained in:
luwenpeng
2023-05-25 17:05:22 +08:00
parent 79e71c4240
commit dbfde6ce82
5 changed files with 73 additions and 8 deletions

View File

@@ -1048,16 +1048,18 @@ static void handle_inject_packet(marsio_buff_t *rx_buff, struct thread_ctx *thre
struct g_vxlan *g_vxlan_hdr = NULL;
struct session_ctx *session_ctx = NULL;
struct selected_chaining *chaining = NULL;
memset(&meta, 0, sizeof(struct metadata));
int sf_index = 0;
int raw_len = marsio_buff_datalen(rx_buff);
char *raw_data = marsio_buff_mtod(rx_buff);
if (g_vxlan_decode(&g_vxlan_hdr, raw_data, raw_len) == -1)
{
goto error_block;
throughput_metrics_inc(&(g_metrics->device.endpoint_drop), 1, raw_len);
action_err_block(rx_buff, &meta, NULL, thread_ctx);
return;
}
memset(&meta, 0, sizeof(struct metadata));
meta.raw_data = (char *)g_vxlan_hdr + sizeof(struct g_vxlan);
meta.raw_len = raw_len - sizeof(struct ethhdr) - sizeof(struct ip) - sizeof(struct udp_hdr) - sizeof(struct g_vxlan);
meta.l7offset = 0;