Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqtt_set_will_options 使用问题 #109

Open
Zeepunt opened this issue Sep 19, 2024 · 0 comments
Open

mqtt_set_will_options 使用问题 #109

Zeepunt opened this issue Sep 19, 2024 · 0 comments

Comments

@Zeepunt
Copy link

Zeepunt commented Sep 19, 2024

目前看代码发现,使用 mqtt_set_will_options 函数设置遗嘱时,会分配内存。

int mqtt_set_will_options(mqtt_client_t* c, char *topic, mqtt_qos_t qos, uint8_t retained, char *message)
{
    if (NULL == c->mqtt_will_options) {
        c->mqtt_will_options = (mqtt_will_options_t *)platform_memory_alloc(sizeof(mqtt_will_options_t));
        MQTT_ROBUSTNESS_CHECK(c->mqtt_will_options, MQTT_MEM_NOT_ENOUGH_ERROR);
    }

但是在使用 mqtt_release 释放 client 时并没有释放该内存,请问下这部分在哪里处理的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant