X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=a11215d750124d61ba708f9f5ef543d4725d9af5;hb=d6e4c56b9602d87147426b9e3f8dbaad9b936027;hp=94f075b460f2b9ed541e0610691cb18bfb1a67d0;hpb=239f3aecd75a741c8dbca13c7793be2795024dd0;p=lttng-tools.git diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 94f075b46..a11215d75 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1569,16 +1569,20 @@ int lttng_create_session_live(const char *name, const char *url, lsm.cmd_type = LTTNG_CREATE_SESSION_LIVE; lttng_ctl_copy_string(lsm.session.name, name, sizeof(lsm.session.name)); - size = uri_parse_str_urls(url, NULL, &uris); - if (size <= 0) { - ret = -LTTNG_ERR_INVALID; - goto end; - } + if (url) { + size = uri_parse_str_urls(url, NULL, &uris); + if (size <= 0) { + ret = -LTTNG_ERR_INVALID; + goto end; + } - /* file:// is not accepted for live session. */ - if (uris[0].dtype == LTTNG_DST_PATH) { - ret = -LTTNG_ERR_INVALID; - goto end; + /* file:// is not accepted for live session. */ + if (uris[0].dtype == LTTNG_DST_PATH) { + ret = -LTTNG_ERR_INVALID; + goto end; + } + } else { + size = 0; } lsm.u.session_live.nb_uri = size;