From: Mathieu Desnoyers Date: Thu, 14 Jul 2011 18:13:06 +0000 (-0400) Subject: Fix context duplicate name check X-Git-Tag: v2.0-pre1~23 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4b58a8e449024771b31c5a827f99d52de19e6870;p=lttng-modules.git Fix context duplicate name check Signed-off-by: Mathieu Desnoyers --- 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; }