summaryrefslogtreecommitdiffstats
path: root/hcid/storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/storage.c')
-rw-r--r--hcid/storage.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hcid/storage.c b/hcid/storage.c
index e270cbd8..e8d2ce1c 100644
--- a/hcid/storage.c
+++ b/hcid/storage.c
@@ -37,6 +37,7 @@
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
+#include <stdlib.h>
#include <malloc.h>
#include <sys/file.h>
#include <sys/stat.h>
@@ -87,6 +88,8 @@ int read_device_name(bdaddr_t *local, bdaddr_t *peer, char *name)
str[248] = '\0';
strcpy(name, str);
+ free(str);
+
return 0;
}
@@ -162,6 +165,8 @@ int read_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key)
key[i] = (uint8_t) strtol(tmp, NULL, 16);
}
+ free(str);
+
return 0;
}
@@ -181,5 +186,7 @@ int read_pin_code(bdaddr_t *local, bdaddr_t *peer, char *pin)
strncpy(pin, str, 16);
len = strlen(pin);
+ free(str);
+
return len;
}