Skip to content

Commit 645d837

Browse files
authored
multiple sub fix from crt land (aws#148)
*Description of changes:* - downstream fix for awslabs/aws-c-mqtt#141
1 parent dc509de commit 645d837

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/mqtt/MqttClient.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,13 @@ namespace Aws
181181
if (callbackData->onSubAck)
182182
{
183183
size_t length = aws_array_list_length(topicSubacks);
184-
Vector<String> topics(length);
184+
Vector<String> topics;
185+
topics.reserve(length);
185186
QOS qos = AWS_MQTT_QOS_AT_MOST_ONCE;
186187
for (size_t i = 0; i < length; ++i)
187188
{
188189
aws_mqtt_topic_subscription *subscription = NULL;
189-
aws_array_list_get_at_ptr(topicSubacks, reinterpret_cast<void **>(&subscription), i);
190+
aws_array_list_get_at(topicSubacks, &subscription, i);
190191
topics.push_back(
191192
String(reinterpret_cast<char *>(subscription->topic.ptr), subscription->topic.len));
192193
qos = subscription->qos;

0 commit comments

Comments
 (0)