- in testcode, free async ids, initialise array, and check for null

pointer during test of the test.  And use exit for return to note
  irregular program stop.


git-svn-id: file:///svn/unbound/trunk@4897 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2018-09-13 09:45:07 +00:00
parent 9a82526b91
commit fe8b22caa1
7 changed files with 36 additions and 15 deletions
+4 -3
View File
@@ -532,6 +532,7 @@ qlist_add_line(struct perfinfo* info, char* line, int no)
printf("error parsing query %d: %s\n", no, line);
exit(1);
}
log_assert(info->buf->_data);
sldns_buffer_write_u16_at(info->buf, 0, (uint16_t)info->qlist_size);
if(info->qlist_size + 1 > info->qlist_capacity) {
qlist_grow_capacity(info);
@@ -610,7 +611,7 @@ int main(int argc, char* argv[])
case 'd':
if(atoi(optarg)==0 && strcmp(optarg, "0")!=0) {
printf("-d not a number %s", optarg);
return 1;
exit(1);
}
info.duration = atoi(optarg);
break;
@@ -635,11 +636,11 @@ int main(int argc, char* argv[])
}
if(!extstrtoaddr(argv[0], &info.dest, &info.destlen)) {
printf("Could not parse ip: %s\n", argv[0]);
return 1;
exit(1);
}
if(info.qlist_size == 0) {
printf("No queries to make, use -f or -a.\n");
return 1;
exit(1);
}
/* do the performance test */