Name: nfc-plugin-emul
Summary: NFC emul plugin
-Version: 0.0.20
+Version: 0.0.23
Release: 0
Group: TO_BE/FILLED_IN
License: Apache-2.0
rm -rf %{buildroot}
%make_install
-install -D -m 0644 LICENSE.Apache-2.0 %{buildroot}/%{_datadir}/license/nfc-plugin-emul
-
mkdir -p %{buildroot}/usr/lib/udev/rules.d
cp 98-nfc-plugin-emul.rules %{buildroot}/usr/lib/udev/rules.d/98-nfc-plugin-emul.rules
%post -p /sbin/ldconfig
%files
+%license LICENSE.Apache-2.0
%defattr(-,root,root,-)
/usr/lib/nfc/libnfc-plugin.so
-%{_datadir}/license/nfc-plugin-emul
/usr/lib/udev/rules.d/98-nfc-plugin-emul.rules
_net_nfc_store_ndef_message(&rawdata);
+ _nfc_emul_util_free_mem(rawdata.buffer);
+
DEBUG_EMUL_END();
return retval;
{
DEBUG_EMUL_BEGIN();
- if(emul_msg != NULL && emul_msg->file_data != NULL)
+ if(emul_msg != NULL)
{
- free(emul_msg->file_data);
+ if(emul_msg->file_data != NULL)
+ free(emul_msg->file_data);
+
free(emul_msg);
}
if(rawdata.length > 0)
memcpy(temp, rawdata.buffer, rawdata.length);
+ _nfc_emul_util_free_mem(rawdata.buffer);
+
DEBUG_EMUL_END();
}
data_s rawdata = { NULL, 0 };
_net_nfc_retrieve_ndef_message(&rawdata);
+ _nfc_emul_util_free_mem(rawdata.buffer);
if (emul_msg->record_count == 0 || rawdata.length == 0)
{
DEBUG_MSG("epoll wait >>>>");
- if(emulMsg_poll_fd == -1 || emulMsg_file_fd == -1)
- {
- DEBUG_MSG("client is deinitialized. ");
- condition = 0;
- }
-
while((num_of_files = epoll_wait(emulMsg_poll_fd, emulMsg_poll_events, EPOLL_SIZE, -1)) == 0) {
DEBUG_MSG("no data is changed ");
}
DEBUG_EMUL_BEGIN();
_net_nfc_retrieve_ndef_message(&rawdata);
+ _nfc_emul_util_free_mem(rawdata.buffer);
if (_net_nfc_emul_get_is_tag_attached())
{
*result = _net_nfc_retrieve_ndef_message(&rawdata);
if(*result != NET_NFC_OK)
+ {
+ _nfc_emul_util_free_mem(rawdata.buffer);
return false;
+ }
real_data_size = rawdata.length;
{
DEBUG_ERR_MSG("read ndef_msg is failed >>> real_data_size is zero");
*result = NET_NFC_NO_NDEF_MESSAGE;
+ _nfc_emul_util_free_mem(rawdata.buffer);
return false;
}
if(*data == NULL)
{
*result = NET_NFC_ALLOC_FAIL;
+ _nfc_emul_util_free_mem(rawdata.buffer);
return false;
}
{
free(*data);
*result = NET_NFC_ALLOC_FAIL;
+ _nfc_emul_util_free_mem(rawdata.buffer);
return false;
}
/* copy rawdata to data->buffer */
memcpy((*data)->buffer, rawdata.buffer, real_data_size);
+ _nfc_emul_util_free_mem(rawdata.buffer);
DEBUG_EMUL_END();