diff --git a/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c b/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c index eba560abb7f1eab5629031af85de812c70a75bde..86402bfdf0a67c88ee7387c471ded57473e2e5ec 100644 --- a/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c +++ b/sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c @@ -380,11 +380,11 @@ static gnrc_pktsnip_t *_create_snip(gnrc_pktsnip_t *next, const void *data, size _pktbuf_free(pkt, sizeof(gnrc_pktsnip_t)); return NULL; } + if (data != NULL) { + memcpy(_data, data, size); + } } _set_pktsnip(pkt, next, _data, size, type); - if (data != NULL) { - memcpy(_data, data, size); - } return pkt; }