Fix client test leaks.

This commit is contained in:
Roger A. Light
2020-08-12 15:18:17 +01:00
parent 2dc8d2a19a
commit ba2c00137d
67 changed files with 85 additions and 0 deletions
+1
View File
@@ -48,6 +48,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -36,6 +36,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -28,6 +28,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -29,6 +29,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -32,6 +32,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -30,6 +30,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -70,6 +70,7 @@ int main(int argc, char *argv[])
while(1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -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();
+1
View File
@@ -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();
+1
View File
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -40,6 +40,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+1
View File
@@ -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();
+1
View File
@@ -48,6 +48,7 @@ int main(int argc, char *argv[])
while(run == -1){
mosq->loop();
}
delete mosq;
mosqpp::lib_cleanup();
+2
View File
@@ -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{
+8
View File
@@ -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;
}