From 22c9883131a8cac3e1fcf2ebf025518e59536ad0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Thu, 12 Jul 2018 19:34:51 +0200 Subject: [PATCH] afb-api-v3: Fix wrong error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Idc2d85ccf71fb7c88a3bbcf981c316b5ba70f434 Signed-off-by: José Bollo --- src/afb-api-v3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/afb-api-v3.c b/src/afb-api-v3.c index 11bc35ff..1bda6b08 100644 --- a/src/afb-api-v3.c +++ b/src/afb-api-v3.c @@ -194,8 +194,10 @@ struct afb_api_v3 *afb_api_v3_create( /* allocates the description */ api = calloc(1, sizeof *api + (copy_info && info ? 1 + strlen(info) : 0)); - if (!api) + if (!api) { + ERROR("out of memory"); goto oom; + } api->refcount = 1; if (!info) api->info = &nulchar; @@ -223,7 +225,6 @@ oom3: oom2: free(api); oom: - ERROR("out of memory"); return NULL; } -- 2.16.6