Fix coverity issues 83/260883/1 accepted/tizen/unified/20210707.130515 submit/tizen/20210706.191553
authorsooyeon <sooyeon.kim@samsung.com>
Tue, 6 Jul 2021 17:15:59 +0000 (02:15 +0900)
committersooyeon <sooyeon.kim@samsung.com>
Tue, 6 Jul 2021 17:16:02 +0000 (02:16 +0900)
* Add to release resource
* Add a checker of return value

Change-Id: Id0f9d0c8c55459ec2f48edb82d997fd697e89743
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
client/tts_tidl.c
server/ttse.c

index 513ecf6..1ca6302 100644 (file)
@@ -590,6 +590,7 @@ int tts_tidl_request_get_private_data(int uid, const char* key, char** data)
 
        if (0 != rpc_port_proxy_tts_invoke_get_private(info->rpc_h, uid, key, &tmp)) {
                SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request get private data : Fail to invoke message");
+               free(tmp);
                return TTS_ERROR_OPERATION_FAILED;
        }
        SLOG(LOG_DEBUG, TAG_TTSC, "<<<<");
index f8a9617..30f5297 100755 (executable)
@@ -82,9 +82,9 @@ static ttsd_mode_e __get_mode_from_appid()
 {
        int pid = getpid();
        char* appid = NULL;
-       app_manager_get_app_id(pid, &appid);
+       int ret = app_manager_get_app_id(pid, &appid);
 
-       if (NULL == appid) {
+       if (0 != ret || NULL == appid) {
                return TTSD_MODE_DEFAULT;
        }