name = strdup(value_view->data);
if (!name) {
ret = LTTNG_ERR_NOMEM;
+ goto error;
}
}
}
/* Only expect a payload for name value types. */
- if (is_value_type_name(value_type) && value_view->size == 0) {
+ if (is_value_type_name(value_type) &&
+ (!value_view || value_view->size == 0)) {
ret = LTTNG_ERR_INVALID_PROTOCOL;
goto error;
- } else if (!is_value_type_name(value_type) && value_view->size != 0) {
+ } else if (!is_value_type_name(value_type) && value_view &&
+ value_view->size != 0) {
ret = LTTNG_ERR_INVALID_PROTOCOL;
goto error;
}