Use near_ndef_msg_free() instead of open-coding it. Signed-off-by: Krzysztof Kozlowski --- src/tag.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tag.c b/src/tag.c index 520368b1552c..ce8c477d9527 100644 --- a/src/tag.c +++ b/src/tag.c @@ -459,14 +459,12 @@ static DBusMessage *write_ndef(DBusConnection *conn, break; default: - g_free(ndef->data); - g_free(ndef); + near_ndef_msg_free(ndef); return __near_error_failed(msg, EOPNOTSUPP); } - g_free(ndef->data); - g_free(ndef); + near_ndef_msg_free(ndef); tag->write_ndef = ndef_with_header; err = __near_tag_write(tag, ndef_with_header, write_cb); -- 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