From 49793792461c4af7d5ce3708d4b7b0313c5af00f Mon Sep 17 00:00:00 2001 From: wenyongh Date: Sat, 22 Feb 2020 09:39:46 +0800 Subject: [PATCH] Update iwasm_main.c --- samples/simple/src/iwasm_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/simple/src/iwasm_main.c b/samples/simple/src/iwasm_main.c index 06c2704c6..e9b389d21 100644 --- a/samples/simple/src/iwasm_main.c +++ b/samples/simple/src/iwasm_main.c @@ -361,7 +361,11 @@ static attr_container_t * read_test_sensor(void * sensor) //luc: for test attr_container_t *attr_obj = attr_container_create("read test sensor data"); if (attr_obj) { - attr_container_set_string(&attr_obj, "name", "read test sensor"); + bool ret = attr_container_set_string(&attr_obj, "name", "read test sensor"); + if (!ret) { + attr_container_destroy(attr_obj); + return NULL; + } return attr_obj; } return NULL;