* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <common/common.h>
#include <common/index/index.h>
+#include <common/compat/string.h>
#include "lttng-relayd.h"
#include "viewer-stream.h"
goto error;
}
- vstream->path_name = strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
+ vstream->path_name = lttng_strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
if (vstream->path_name == NULL) {
PERROR("relay viewer path_name alloc");
goto error;
}
- vstream->channel_name = strndup(stream->channel_name,
+ vstream->channel_name = lttng_strndup(stream->channel_name,
LTTNG_VIEWER_NAME_MAX);
if (vstream->channel_name == NULL) {
PERROR("relay viewer channel_name alloc");
struct lttng_ht_iter iter;
struct relay_viewer_stream *vstream;
+ if (!viewer_streams_ht) {
+ return;
+ }
+
rcu_read_lock();
cds_lfht_for_each_entry(viewer_streams_ht->ht, &iter.iter, vstream,
stream_n.node) {