From e333c131886530b542f20d0cbb9894ae35a6f72f Mon Sep 17 00:00:00 2001 From: Isaac Hier Date: Tue, 6 Mar 2018 17:22:50 -0500 Subject: [PATCH] Fix invalid allocation of null span context --- src/opentracing-c/tracer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opentracing-c/tracer.c b/src/opentracing-c/tracer.c index fff4081..f3666d7 100644 --- a/src/opentracing-c/tracer.c +++ b/src/opentracing-c/tracer.c @@ -181,7 +181,8 @@ static int null_tracer_extract(opentracing_tracer* tracer, (void) format; (void) carrier; assert(span_context != NULL); - *span_context = malloc(sizeof(span_context)); + *span_context = + (opentracing_span_context*) malloc(sizeof(opentracing_span_context)); if (*span_context == NULL) { return 0; }