X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Flttng-live%2Flttng-live.c;h=8f734f7bd9906e9f844bd86bd2cb4a21681dd318;hb=cf5d433239d042b4009ff8d9a5aa6ed42724c53a;hp=c44d02c7e38c51d7797a2aad021404978780d30b;hpb=4a74436710b248274ffe9e038da0bd41af8a3d8d;p=babeltrace.git diff --git a/formats/lttng-live/lttng-live.c b/formats/lttng-live/lttng-live.c index c44d02c7..8f734f7b 100644 --- a/formats/lttng-live/lttng-live.c +++ b/formats/lttng-live/lttng-live.c @@ -55,7 +55,7 @@ static int parse_url(const char *path, char *hostname, int *port, } /* TODO : parse for IPv6 as well */ /* Parse the hostname or IP */ - ret = sscanf(path + proto_offset, "%[a-zA-Z.1-9%-]%s", + ret = sscanf(path + proto_offset, "%[a-zA-Z.0-9%-]%s", hostname, remain); if (ret == 2) { /* Optional port number */ @@ -101,15 +101,8 @@ static int lttng_live_open_trace_read(const char *path) int ret = 0; struct lttng_live_ctx ctx; - /* set default */ - opt_context_field_names = 1; - opt_payload_field_names = 1; - ctx.session = g_new0(struct lttng_live_session, 1); - if (!ctx.session) { - ret = -1; - goto end; - } + /* We need a pointer to the context from the packet_seek function. */ ctx.session->ctx = &ctx; @@ -148,7 +141,6 @@ static int lttng_live_open_trace_read(const char *path) end_free: g_hash_table_destroy(ctx.session->ctf_traces); g_free(ctx.session); -end: g_free(ctx.session->streams); return ret; }