The uniqueness of the domain CAN NOT be enforced with the XML xsd schema
so if the same domains are seen, return an error.
Fixes coverity issue
1191755.
Signed-off-by: David Goulet <dgoulet@efficios.com>
switch (domain->type) {
case LTTNG_DOMAIN_KERNEL:
+ if (kernel_domain) {
+ /* Same domain seen twice, invalid! */
+ goto domain_init_error;
+ }
kernel_domain = domain;
break;
case LTTNG_DOMAIN_UST:
+ if (ust_domain) {
+ /* Same domain seen twice, invalid! */
+ goto domain_init_error;
+ }
ust_domain = domain;
break;
case LTTNG_DOMAIN_JUL:
+ if (jul_domain) {
+ /* Same domain seen twice, invalid! */
+ goto domain_init_error;
+ }
jul_domain = domain;
break;
default: