uri_parse() can only ever return values [-1, 2] and callers only handle
those values. This causes Coverity to report possible leaks and other
errors when analyzing callers.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ida29691420228f0425cc908641bcd85208d66236
goto parse_error;
}
+ /* 1 and 2 are the only expected values on success. */
+ assert(size_ctrl == 1 || size_ctrl == 2);
+
/* At this point, we know there is at least one URI in the array */
set_default_uri_attr(&ctrl_uris[0], LTTNG_STREAM_CONTROL);
} else if (size_data == 2) {
ERR("Data URL can not be set with the net[4|6]:// protocol");
goto error;
+ } else {
+ /* 1 and 2 are the only expected values on success. */
+ assert(size_data == 1);
}
set_default_uri_attr(&data_uris[0], LTTNG_STREAM_DATA);