diff options
author | Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> | 2010-10-28 04:00:23 +0200 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2010-10-28 10:13:06 -0700 |
commit | cf5cd1520ea32d2b65712a36a105f396df07345c (patch) | |
tree | 6047e8487d8e95e087c8c106364faacf52f8f11d /src/phFriNfc_LlcpTransport_Connectionless.c | |
parent | 99eeb8ab747ce32a0b99a9abfe1c06eb6d583abc (diff) | |
download | libnfc-nxp-cf5cd1520ea32d2b65712a36a105f396df07345c.tar.gz |
Fixed LLCP Service Name matching failure.
Service Name is now copied in the libnfc to avoid referencing a pointer that
may not be valid during the whole socket life.
Change-Id: I6572366ac51502d189cc8f1350fa089c11cc2bea
Diffstat (limited to 'src/phFriNfc_LlcpTransport_Connectionless.c')
-rw-r--r-- | src/phFriNfc_LlcpTransport_Connectionless.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/phFriNfc_LlcpTransport_Connectionless.c b/src/phFriNfc_LlcpTransport_Connectionless.c index 67591ad..60c8d49 100644 --- a/src/phFriNfc_LlcpTransport_Connectionless.c +++ b/src/phFriNfc_LlcpTransport_Connectionless.c @@ -22,6 +22,7 @@ * */ /*include files*/ +#include <phOsalNfc.h> #include <phLibNfcStatus.h> #include <phLibNfc.h> #include <phNfcLlcpTypes.h> @@ -105,12 +106,17 @@ NFCSTATUS phFriNfc_LlcpTransport_Connectionless_Close(phFriNfc_LlcpTransport_Soc pLlcpSocket->pfSocketListen_Cb = NULL; pLlcpSocket->pfSocketConnect_Cb = NULL; pLlcpSocket->pfSocketDisconnect_Cb = NULL; - pLlcpSocket->pServiceName = NULL; pLlcpSocket->socket_VS = 0; pLlcpSocket->socket_VSA = 0; pLlcpSocket->socket_VR = 0; pLlcpSocket->socket_VRA = 0; + if (pLlcpSocket->sServiceName.buffer != NULL) { + phOsalNfc_FreeMemory(pLlcpSocket->sServiceName.buffer); + } + pLlcpSocket->sServiceName.buffer = NULL; + pLlcpSocket->sServiceName.length = 0; + return NFCSTATUS_SUCCESS; } |