mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-12 18:43:47 +00:00
Adds nfc_free() function to freed allocated buffers
Fixes issue 228 (Thanks to Alex Lian)
This commit is contained in:
13
libnfc/nfc.c
13
libnfc/nfc.c
@@ -1168,6 +1168,17 @@ nfc_version(void)
|
||||
#endif // GIT_REVISION
|
||||
}
|
||||
|
||||
/** @ingroup misc
|
||||
* @brief Free buffer allocated by libnfc
|
||||
*
|
||||
* @param pointer on buffer that need to be freed
|
||||
*/
|
||||
void
|
||||
nfc_free(void *p)
|
||||
{
|
||||
free(p);
|
||||
}
|
||||
|
||||
/** @ingroup misc
|
||||
* @brief Print information about NFC device
|
||||
* @return Upon successful return, this function returns the number of characters printed (excluding the null byte used to end output to strings), otherwise returns libnfc's error code (negative value)
|
||||
@@ -1255,7 +1266,7 @@ str_nfc_modulation_type(const nfc_modulation_type nmt)
|
||||
* @param nt \a nfc_target struct to print
|
||||
* @param buf pointer where string will be allocated, then nfc target information printed
|
||||
*
|
||||
* @warning *buf must be freed.
|
||||
* @warning *buf must be freed using nfc_free()
|
||||
*/
|
||||
int
|
||||
str_nfc_target(char **buf, const nfc_target nt, bool verbose)
|
||||
|
||||
Reference in New Issue
Block a user