From 45ae99503f5be818d79a1cdbf6540a717ac02ce7 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Thu, 10 Oct 2019 11:58:00 +0200 Subject: Correct behaviour of halmap handling function Correct behaviour of halmap handling function by : - Avoid unnecessary set to 0 newly allocated data. - Correct return value. BUG-AGL: SPEC-2884 Change-Id: I647812e8fe8770954ada5cfded2505bf9f412699 Signed-off-by: Jonathan Aillet --- src/4a-internals-hal/4a-internals-hal-cb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/4a-internals-hal/4a-internals-hal-cb.c b/src/4a-internals-hal/4a-internals-hal-cb.c index bab3c8c..0f32bfb 100644 --- a/src/4a-internals-hal/4a-internals-hal-cb.c +++ b/src/4a-internals-hal/4a-internals-hal-cb.c @@ -509,7 +509,7 @@ int InternalHalHandleOneHalMapObject(afb_api_t apiHandle, struct InternalHalAlsa } if(halMapData->actionJ) { - toLoadAction = calloc(1, sizeof(CtlActionT)); + toLoadAction = malloc(sizeof(CtlActionT)); if(! toLoadAction) { AFB_API_ERROR(apiHandle, "Didn't succeed to allocate structure used to store action to perform " @@ -575,7 +575,7 @@ int InternalHalHandleOneHalMapObject(afb_api_t apiHandle, struct InternalHalAlsa halMapData->uid, halMapData->ctl.name ? halMapData->ctl.name : "'N/A'", halMapData->cardNb); - return -10; + return -11; } return 0; -- cgit 1.2.3-korg