if (NULL != err_msg) {
client->err_msg = strdup(err_msg);
+ if (NULL == client->err_msg) {
+ return VC_ERROR_OUT_OF_MEMORY;
+ }
}
return 0;
if (NULL != client->err_msg) {
*err_msg = strdup(client->err_msg);
+ if (NULL == *err_msg) {
+ return VC_ERROR_OUT_OF_MEMORY;
+ }
}
return 0;
/**
* @brief Gets the current error message.
*
-* @remarks This function should be called during as stt error callback. If not, the error as operation failure will be returned. \n
+* @remarks This function should be called during as vc error callback. If not, the error as operation failure will be returned. \n
* If the function succeeds, @a err_msg must be released using free() when it is no longer required.
*
* @param[out] err_msg The current error message
* @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #VC_ERROR_INVALID_STATE Invalid state
* @retval $VC_ERROR_OPERATION_FAILED Operation failure
+* @retval #VC_ERROR_OUT_OF_MEMORY Out of memory
*
* @see vc_error_cb()
*/