Skip to content

Commit 4ff7ebb

Browse files
committed
resolved free and long datas
1 parent dea37cb commit 4ff7ebb

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

TEST_APPS/device/nfcapp/nfcprocessEeprom.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ void NFCProcessEEPROM::on_ndef_message_written(nfc_err_t result)
9999
}
100100
// complete the async test method here
101101
cmd_ready(CMDLINE_RETCODE_SUCCESS);
102-
free(long_string); // free buffer allocated by the command class now
103102
}
104103

105104
void NFCProcessEEPROM::on_ndef_message_read(nfc_err_t result)

TEST_APPS/device/nfcapp/nfctestshim.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,8 @@ void NFCTestShim::cmd_erase()
285285
void NFCTestShim::cmd_write_long(char *text_string)
286286
{
287287
MessageBuilder builder(_ndef_poster_message);
288-
long_string = text_string; // copy the pointer and free it when the write completes
289288
Text text(Text::UTF8, span_from_cstr("en-US"),
290-
span_from_cstr((const char *)(long_string)));
289+
span_from_cstr((const char *)(text_string)));
291290

292291
text.append_as_record(builder, true);
293292
_ndef_write_buffer_used = builder.get_message().size();
@@ -299,8 +298,8 @@ void NFCTestShim::cmd_write_long(char *text_string)
299298
// not on a wire, and we just stored the message in _ndef_write_buffer above
300299
set_last_nfc_error(NFC_OK);
301300
cmd_ready(CMDLINE_RETCODE_SUCCESS);
302-
free(long_string); // free buffer allocated by the command class now
303301
#endif
302+
free(text_string); // free buffer allocated by the command class now
304303
trace_printf("NFCTestShim::write_long() exit\r\n");
305304
}
306305

TEST_APPS/device/nfcapp/nfctestshim.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class NFCTestShim {
100100
uint8_t _ndef_buffer[MBED_CONF_APP_TEST_NDEF_MSG_MAX]; // driver I/O buffer
101101
bool _discovery_restart; // default true, restart discovery loop again on remote disconnect
102102
events::EventQueue &_queue;
103-
char *long_string;
104103
};
105104

106105
// forward declare single instance

TEST_APPS/icetea_plugins/nfc_test_parsers.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ def trace_parser(self, response):
115115
if data is not False:
116116
started_read_data = True
117117
if started_read_data: # read data until we see a }} pair
118-
values = self.find_all_hex_data(line, "([0-9a-f\s]*)")
118+
line_values = ""
119+
if "{{nfcmessage=" in line:
120+
line_values = line[13:]
121+
else:
122+
line_values = line
123+
values = self.find_all_hex_data(line_values, "([0-9a-f\s]*)")
119124
if values is not False:
120-
if "{{nfcmessage" in line:
121-
value = values[0] # first (and possibly only data line)
122-
else:
123-
value += values[0] # concatenate (2nd and possibly last data line)
124125
partial_data += value
125126
if PluginBase.find_one(line, ".*(}})") is not False: # search for end marker
126127
started_read_data = False

0 commit comments

Comments
 (0)