summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-11 12:24:49 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:52:51 +0200
commit4e05b191805c728fb2208bce4491eb322681b0c9 (patch)
treee95d2dc0b1691871bf77b7d06f21e94a7df5becc
parent111cb2ab8e3a391f759bebf6a94bb5754333b8f4 (diff)
Test 'asprintf' return
Test 'asprintf' return to avoid compilation warning when building with yocto. Change-Id: I322890a149aff86c30afc7a654540d82dc0a8957 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
index 57bc079..3d45260 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
@@ -68,7 +68,10 @@ void HalCtlsDispatchApiEvent(afb_dynapi *apiHandle, const char *evtLabel, json_o
snprintf(cardIdString, 6, "hw:%i", currentHalData->sndCardId);
currentHalAlsaCtlsT = currentHalData->ctlHalSpecificData->ctlHalAlsaMapT;
- asprintf(&alsaCoreLabel, "%s/%s", ALSACORE_API, cardIdString);
+ if(asprintf(&alsaCoreLabel, "%s/%s", ALSACORE_API, cardIdString) < 0) {
+ AFB_ApiError(apiHandle, "%s: Didn't succeed to generate string for alascore events catching", __func__);
+ return;
+ }
if(strcmp(evtLabel, alsaCoreLabel) == 0 &&
! wrap_json_unpack(eventJ, "{s:i s:o !}", "id", &numid, "val", &valuesJ)) {