Diff between 69f0114a239b0c797bad9cc752dd15100627e507 and 45ad006223b381e715b951d4df87587f4bd6a5f2

Changed Files

File Additions Deletions Status
src/adapter.c +3 -2 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index b184eed..f4fbf82 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3091,12 +3091,12 @@ static GSList *get_ltk_info(GKeyFile *key_file, const char *peer,
 static struct irk_info *get_irk_info(GKeyFile *key_file, const char *peer,
 							uint8_t bdaddr_type)
 {
-	struct irk_info *irk;
+	struct irk_info *irk = NULL;
 	char *str;
 
 	str = g_key_file_get_string(key_file, "IdentityResolvingKey", "Key", NULL);
 	if (!str || strlen(str) < 32)
-		return NULL;
+		goto failed;
 
 	irk = g_new0(struct irk_info, 1);
 
@@ -3108,6 +3108,7 @@ static struct irk_info *get_irk_info(GKeyFile *key_file, const char *peer,
 	else
 		str2buf(&str[0], irk->val, sizeof(irk->val));
 
+failed:
 	g_free(str);
 
 	return irk;