return NOTI_EX_ERROR_INVALID_PARAMETER;
}
+ Handle** list_item = nullptr;
+
try {
ReporterStub* stub = static_cast<ReporterStub*>(handle);
list<unique_ptr<AbstractItem>> list_ptr = stub->FindByChannel(channel);
int size = list_ptr.size();
int i = 0;
- Handle* list_item[size];
+ list_item = (Handle**)calloc(size, sizeof(Handle*));
for (auto& ptr : list_ptr)
list_item[i++] = new Handle(std::move(ptr));
*count = size;
} catch (Exception &ex) {
LOGE("%s %d", ex.what(), ex.GetErrorCode());
+ free(list_item);
return NOTI_EX_ERROR_IO_ERROR;
}
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
+ Handle** list_item = nullptr;
+
try {
ReporterStub* stub = static_cast<ReporterStub*>(handle);
list<unique_ptr<AbstractItem>> list_ptr = stub->FindAll();
int size = list_ptr.size();
int i = 0;
- Handle* list_item[size];
+ list_item = (Handle**)calloc(size, sizeof(Handle*));
for (auto& ptr : list_ptr)
list_item[i++] = new Handle(std::move(ptr));
*count = size;
} catch (Exception &ex) {
LOGE("%s %d", ex.what(), ex.GetErrorCode());
+ free(list_item);
return NOTI_EX_ERROR_IO_ERROR;
}