mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-26 03:43:47 +08:00
Fix client test leaks.
This commit is contained in:
@@ -48,6 +48,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ int main(int argc, char *argv[])
|
||||
while(1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ int main(int argc, char *argv[])
|
||||
if(mosq->tls_set("this/file/doesnt/exist") == MOSQ_ERR_INVAL){
|
||||
rc = 0;
|
||||
}
|
||||
delete mosq;
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
return rc;
|
||||
|
||||
@@ -57,6 +57,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ int main(int argc, char *argv[])
|
||||
while(run == -1){
|
||||
mosq->loop();
|
||||
}
|
||||
delete mosq;
|
||||
|
||||
mosqpp::lib_cleanup();
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@ int main(int argc, char *argv[])
|
||||
mosq->connect("localhost", port, 60);
|
||||
|
||||
rc = mosq->loop_forever();
|
||||
delete mosq;
|
||||
mosqpp::lib_cleanup();
|
||||
if(rc == MOSQ_ERR_ERRNO && errno == EPROTO){
|
||||
return 0;
|
||||
}else{
|
||||
|
||||
@@ -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