Skip to content

Commit

Permalink
Merge pull request RIOT-OS#16584 from jia200x/pr/fix_gnrc_lorawan_mem…
Browse files Browse the repository at this point in the history
…ory_leak

gnrc_netif/lorawan: drop netif header on send
  • Loading branch information
MrKevinWeiss authored Jun 25, 2021
2 parents 472a8d1 + 5808a16 commit 05b61e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sys/net/gnrc/netif/lorawan/gnrc_netif_lorawan.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,15 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
dst = gnrc_netif_hdr_get_dst_addr(netif_hdr);

assert(payload->type == GNRC_NETTYPE_NETIF);
head = payload->next;
port = dst[0];

if (netif_hdr->dst_l2addr_len != sizeof(port)) {
goto end;
}

/* Remove the netif hdr snip and point to the MSDU */
head = gnrc_pktbuf_remove_snip(payload, payload);

}
else {
head = payload;
Expand Down

0 comments on commit 05b61e8

Please sign in to comment.