diff --git a/source/mqtt5_client.c b/source/mqtt5_client.c index 99b0549e1..e07eb914a 100644 --- a/source/mqtt5_client.c +++ b/source/mqtt5_client.c @@ -1398,7 +1398,7 @@ static void s_on_publish_complete_fn( size_t user_property_count = 0; if (packet_type == AWS_MQTT5_PT_PUBACK) { - if (puback != NULL) { + if (packet != NULL) { puback = packet; reason_code = puback->reason_code; reason_string = puback->reason_string;