From 4b58a8e449024771b31c5a827f99d52de19e6870 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 14 Jul 2011 14:13:06 -0400 Subject: [PATCH] Fix context duplicate name check Signed-off-by: Mathieu Desnoyers --- ltt-context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ltt-context.c b/ltt-context.c index 6c3890c3..e9a45f3c 100644 --- a/ltt-context.c +++ b/ltt-context.c @@ -21,6 +21,9 @@ int lttng_find_context(struct lttng_ctx *ctx, const char *name) unsigned int i; for (i = 0; i < ctx->nr_fields; i++) { + /* Skip allocated (but non-initialized) contexts */ + if (!ctx->fields[i].event_field.name) + continue; if (!strcmp(ctx->fields[i].event_field.name, name)) return 1; } -- 2.34.1