Fix the behavior of input_selector_get_contents 28/203728/1
authormk5004.lee <mk5004.lee@samsung.com>
Wed, 17 Apr 2019 07:08:08 +0000 (16:08 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Wed, 17 Apr 2019 07:08:08 +0000 (16:08 +0900)
Change-Id: I3c8b814dc38102fb3f47fc2c42f1ca5a52fde432
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
notification-ex/stub.cc

index 041a8a05401607c5d9ab671f20f7429c74c03e96..6bb13287ae2fa422ba98bb34a95998123a3a5653 100644 (file)
@@ -907,12 +907,13 @@ extern "C" EXPORT_API int noti_ex_item_input_selector_get_contents(
   }
   InputSelectorItem* p = static_cast<InputSelectorItem*>(h->Get());
   list<string> contents = p->GetContents();
-  *contents_list = (char**)calloc(contents.size(), sizeof(char*));
+  char **list = (char**)calloc(contents.size(), sizeof(char*));
   int idx = 0;
   for (auto& i : contents) {
-    *contents_list[idx++] = strdup(i.c_str());
+    list[idx++] = strdup(i.c_str());
   }
   *count = contents.size();
+  *contents_list = list;
 
   return NOTI_EX_ERROR_NONE;
 }