alexa-voice-agent-service: fix segmentation fault in release mode
[AGL/meta-agl-devel.git] / meta-speech-framework / meta-aac / recipes-apis / alexa-voiceagent-service / alexa-voiceagent-service / 0005-fix-segmentation-fault-for-release-build-mode.patch
1 Fix segmentation fault for release build mode
2
3 'int IAFBApi::callSync(...)' is missing a return
4 statement. When the sdk is compiled in release mode
5 executing this code results in a segmentation fault.
6
7 According to the C++ standard, a return statement is
8 required on a function that returns a non-void value.
9 Specifically: <<Flowing off the end of a function is
10 equivalent to a return with no value; this results in
11 undefined behaviour in a value-returning function.>>
12
13 The proposed fix provides the missing return statement
14 for IAFBApi's callSync method.
15
16 Upstream-Status: Pending
17
18 Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
19
20 diff --git a/platforms/agl/alexa-voiceagent-service/src/plugins/afb/AFBApiImpl.cpp b/platforms/agl/alexa-voiceagent-service/src/plugins/afb/AFBApiImpl.cpp
21 index 5ed9bce..e68ef7f 100644
22 --- a/src/plugins/afb/AFBApiImpl.cpp
23 +++ b/src/plugins/afb/AFBApiImpl.cpp
24 @@ -77,6 +77,8 @@ int AFBApiImpl::callSync(
25          info = infoStr;
26          free(infoStr);
27      }
28 +
29 +    return rc;
30  }
31
32  /// Shim to transfer C++ function to C callback using void*
33