Use near_ndef_msg_free() instead of open-coding it. Signed-off-by: Krzysztof Kozlowski --- src/snep.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/snep.c b/src/snep.c index c0a1d1a00491..a1e90243c020 100644 --- a/src/snep.c +++ b/src/snep.c @@ -147,8 +147,7 @@ void near_snep_core_parse_handover_record(int client_fd, uint8_t *ndef, near_snep_core_response_with_info(client_fd, NEAR_SNEP_RESP_SUCCESS, msg->data, msg->length); - g_free(msg->data); - g_free(msg); + near_ndef_msg_free(msg); } /* @@ -787,9 +786,7 @@ done: } } - if (ndef) - g_free(ndef->data); - g_free(ndef); + near_ndef_msg_free(ndef); } /* SNEP Core: on P2P push */ -- 2.27.0 _______________________________________________ Linux-nfc mailing list -- linux-nfc@lists.01.org To unsubscribe send an email to linux-nfc-leave@lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s