summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-10-10 11:58:00 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-10-17 11:26:53 +0200
commit45ae99503f5be818d79a1cdbf6540a717ac02ce7 (patch)
treedea0b16fe523200a45e9549884af1f57be64c797
parent22cba05621af107d3564a9fabe4888d9989531ea (diff)
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 <jonathan.aillet@iot.bzh>
-rw-r--r--src/4a-internals-hal/4a-internals-hal-cb.c4
1 files 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;