diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2021-01-04 12:52:50 -0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2021-01-04 12:52:50 -0800 |
commit | b9a37a51c19b95e5fb49bb18ef86075d3fcedcae (patch) | |
tree | 18a41eac2db2834a7470b3d27460234168a95544 | |
parent | 090f0c82f25e2dfd477f15935316df4310d5688f (diff) | |
parent | 13e21b35aaec94eadb1521b483ec35d8a5d68bce (diff) |
Merge 13e21b35aaec94eadb1521b483ec35d8a5d68bce on remote branch
Change-Id: I15838bc39ddc315605cfe6686741c38d7dfa177f
-rw-r--r-- | src/fastrpc_apps_user.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fastrpc_apps_user.c b/src/fastrpc_apps_user.c index 39c904b..7d159cf 100644 --- a/src/fastrpc_apps_user.c +++ b/src/fastrpc_apps_user.c @@ -90,6 +90,7 @@ #define INVALID_KEY (pthread_key_t)(-1) #define MAX_DMA_HANDLES 256 +#define MAX_DLERRSTR_LEN 255 #define FASTRPC_TRACE_INVOKE_START "fastrpc_trace_invoke_start" #define FASTRPC_TRACE_INVOKE_END "fastrpc_trace_invoke_end" @@ -924,14 +925,20 @@ bail: int remote_handle_close(remote_handle h) { - char dlerrstr[255]; + char *dlerrstr = NULL; int dlerr = 0, nErr = AEE_SUCCESS; + size_t err_str_len = MAX_DLERRSTR_LEN*sizeof(char); - VERIFY(AEE_SUCCESS == (nErr = remotectl_close(h, dlerrstr, sizeof(dlerrstr), &dlerr))); + VERIFYC(NULL != (dlerrstr = (char*)calloc(1, err_str_len)), AEE_ENOMEMORY); + VERIFY(AEE_SUCCESS == (nErr = remotectl_close(h, dlerrstr, err_str_len, &dlerr))); VERIFY(AEE_SUCCESS == (nErr = dlerr)); bail: if (nErr != AEE_SUCCESS) { - FARF(HIGH, "Error %x: remote handle close failed. error %s\n", nErr, dlerrstr); + FARF(HIGH, "Error %x: remote handle close failed. error %s\n", nErr, dlerrstr); + } + if (dlerrstr) { + free(dlerrstr); + dlerrstr = NULL; } return nErr; } |