mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-22 16:15:05 +08:00
Fix memory leaks only in tests.
This commit is contained in:
@@ -29,6 +29,7 @@ int main(int argc, char *argv[])
|
||||
print_error("topic", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
if(mosqpp::sub_topic_tokenise("a/deep/topic/hierarchy", &topics, &topic_count)){
|
||||
printf("Out of memory.\n");
|
||||
@@ -42,6 +43,7 @@ int main(int argc, char *argv[])
|
||||
print_error("a/deep/topic/hierarchy", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
if(mosqpp::sub_topic_tokenise("/a/deep/topic/hierarchy", &topics, &topic_count)){
|
||||
printf("Out of memory.\n");
|
||||
@@ -56,6 +58,7 @@ int main(int argc, char *argv[])
|
||||
print_error("/a/deep/topic/hierarchy", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
if(mosqpp::sub_topic_tokenise("a/b/c", &topics, &topic_count)){
|
||||
printf("Out of memory.\n");
|
||||
@@ -68,6 +71,7 @@ int main(int argc, char *argv[])
|
||||
print_error("a/b/c", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
if(mosqpp::sub_topic_tokenise("/a/b/c", &topics, &topic_count)){
|
||||
printf("Out of memory.\n");
|
||||
@@ -81,6 +85,7 @@ int main(int argc, char *argv[])
|
||||
print_error("/a/b/c", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
if(mosqpp::sub_topic_tokenise("a///hierarchy", &topics, &topic_count)){
|
||||
printf("Out of memory.\n");
|
||||
@@ -94,6 +99,7 @@ int main(int argc, char *argv[])
|
||||
print_error("a///hierarchy", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
if(mosqpp::sub_topic_tokenise("/a///hierarchy", &topics, &topic_count)){
|
||||
printf("Out of memory.\n");
|
||||
@@ -108,6 +114,7 @@ int main(int argc, char *argv[])
|
||||
print_error("/a///hierarchy", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
if(mosqpp::sub_topic_tokenise("/a///hierarchy/", &topics, &topic_count)){
|
||||
printf("Out of memory.\n");
|
||||
@@ -123,6 +130,7 @@ int main(int argc, char *argv[])
|
||||
print_error("/a///hierarchy/", topics, topic_count);
|
||||
return 1;
|
||||
}
|
||||
mosqpp::sub_topic_tokens_free(&topics, topic_count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user