Diff between 4cd67264c36dca10ab64608efa94f02556abdc03 and f7138dd76d2b0ec56474c7233ac04dd09166f9b2

Changed Files

File Additions Deletions Status
src/gatt-database.c +3 -1 modified

Full Patch

diff --git a/src/gatt-database.c b/src/gatt-database.c
index ca514db..a1ae7bd 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -2295,8 +2295,10 @@ static int profile_add(struct external_profile *profile, const char *uuid)
 	/* Assign directly to avoid having extra fields */
 	p->name = (const void *) g_strdup_printf("%s%s/%s", profile->owner,
 							profile->path, uuid);
-	if (!p->name)
+	if (!p->name) {
+		free(p);
 		return -ENOMEM;
+	}
 
 	p->remote_uuid = (const void *) g_strdup(uuid);
 	if (!p->remote_uuid) {