Diff between f3c35ed835bda18573e07d02f725be5106ad8ae8 and fb339bde646ca9717f0787aefd6f6cbe4fb13f78

Changed Files

File Additions Deletions Status
tools/rfcomm-tester.c +2 -3 modified

Full Patch

diff --git a/tools/rfcomm-tester.c b/tools/rfcomm-tester.c
index a9adf7f..b78b505 100644
--- a/tools/rfcomm-tester.c
+++ b/tools/rfcomm-tester.c
@@ -30,6 +30,7 @@
 
 #include "src/shared/tester.h"
 #include "src/shared/mgmt.h"
+#include "src/shared/util.h"
 
 struct test_data {
 	struct mgmt *mgmt;
@@ -815,9 +816,7 @@ static void test_server(const void *test_data)
 #define test_rfcomm(name, data, setup, func) \
 	do { \
 		struct test_data *user; \
-		user = malloc(sizeof(struct test_data)); \
-		if (!user) \
-			break; \
+		user = new0(struct test_data, 1); \
 		user->hciemu_type = HCIEMU_TYPE_BREDRLE52; \
 		user->test_data = data; \
 		user->io_id = 0; \