From c4cf4260e3da538d8eb6f80d01253406f48b36e7 Mon Sep 17 00:00:00 2001 From: Tommy Olofsson <tommy.olofsson.90@gmail.com> Date: Mon, 13 Jun 2016 00:49:26 +0200 Subject: [PATCH] Dont deref. NULL. --- lib/c/2014/labcomm2014_decoder.c | 3 ++- lib/c/2014/labcomm2014_encoder.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/c/2014/labcomm2014_decoder.c b/lib/c/2014/labcomm2014_decoder.c index 8e48c26..fe534f3 100644 --- a/lib/c/2014/labcomm2014_decoder.c +++ b/lib/c/2014/labcomm2014_decoder.c @@ -716,8 +716,9 @@ struct labcomm2014_decoder *labcomm2014_decoder_new( LABCOMM_SIGNATURE_ARRAY_INIT(result->local_ref, const struct labcomm2014_signature*); LABCOMM_SIGNATURE_ARRAY_INIT(result->remote_to_local_ref, int); + return &(result->decoder); } - return &(result->decoder); + return NULL; } diff --git a/lib/c/2014/labcomm2014_encoder.c b/lib/c/2014/labcomm2014_encoder.c index 70a2f9c..745edb5 100644 --- a/lib/c/2014/labcomm2014_encoder.c +++ b/lib/c/2014/labcomm2014_encoder.c @@ -420,8 +420,9 @@ static struct labcomm2014_encoder *internal_encoder_new( labcomm2014_writer_end(result->encoder.writer, result->encoder.writer->action_context); } + return &(result->encoder); } - return &(result->encoder); + return NULL; } struct labcomm2014_encoder *labcomm2014_encoder_new( -- GitLab