Fix context duplicate name check
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 14 Jul 2011 18:13:06 +0000 (14:13 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 14 Jul 2011 18:13:06 +0000 (14:13 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-context.c

index 6c3890c3e4a7ba46d2c6f320610a069edbf7dbcd..e9a45f3c50a4de6480a7fc3528d80c40a8895ff1 100644 (file)
@@ -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;
        }
This page took 0.026408 seconds and 4 git commands to generate.