Skip to contentSkip to conversation

test-uuid: fix leak

PATCH Applied Marc-André Lureau 3 participants 3 messages Nov 9, 2016 – Nov 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test-uuid: fix leak

ASAN spotted:
SUMMARY: AddressSanitizer: 74 byte(s) leaked in 2 allocation(s).

---
 tests/test-uuid.c | 1 +
 1 file changed, 1 insertion(+)
tests/test-uuid.c +1 -0
index 77dcdc4..d3a2791 100644
@@ -161,6 +161,7 @@ static void test_uuid_unparse_strdup(void)
         }
         out = qemu_uuid_unparse_strdup(&uuid_test_data[i].uuid);
         g_assert_cmpstr(uuid_test_data[i].uuidstr, ==, out);
+        g_free(out);
     }
 }
 
Signature · 1 line
2.10.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Marc-André Lureau

ASAN spotted:
SUMMARY: AddressSanitizer: 74 byte(s) leaked in 2 allocation(s).

---
 tests/test-uuid.c | 1 +
 1 file changed, 1 insertion(+)
tests/test-uuid.c +0 -0
index 77dcdc4..d3a2791 100644

tests/test-uuid.c static void test_uuid_unparse_strdup(void) · line 167

Quoted 7 lines
tests/test-uuid.c +1 -0
@@ -161,6 +161,7 @@ static void test_uuid_unparse_strdup(void)
         }
         out = qemu_uuid_unparse_strdup(&uuid_test_data[i].uuid);
         g_assert_cmpstr(uuid_test_data[i].uuidstr, ==, out);
+        g_free(out);
     }
 }
 
Applied
#2 lore raw
In reply to Marc-André Lureau
Quoted 23 lines · Marc-André Lureau

ASAN spotted:
SUMMARY: AddressSanitizer: 74 byte(s) leaked in 2 allocation(s).

---
 tests/test-uuid.c | 1 +
 1 file changed, 1 insertion(+)
tests/test-uuid.c +1 -0
index 77dcdc4..d3a2791 100644
@@ -161,6 +161,7 @@ static void test_uuid_unparse_strdup(void)
         }
         out = qemu_uuid_unparse_strdup(&uuid_test_data[i].uuid);
         g_assert_cmpstr(uuid_test_data[i].uuidstr, ==, out);
+        g_free(out);
     }
 }
 
Signature · 1 line
2.10.0

Thanks, applied:

https://github.com/famz/qemu/tree/staging

Fam