Fix coverity issues 51/173051/4 accepted/tizen/unified/20180321.060758 submit/tizen/20180320.040253
authorhj kim <backto.kim@samsung.com>
Mon, 19 Mar 2018 08:59:50 +0000 (17:59 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Tue, 20 Mar 2018 01:56:28 +0000 (01:56 +0000)
Change-Id: I890d8fae5854f0ee47a563034805999e3eec5486

src/ipc/media-thumb-ipc.c

index fc11e28..917aa6a 100755 (executable)
@@ -265,18 +265,19 @@ int _media_thumb_recv_msg(int sock, int header_size, thumbMsg *msg)
 
        if (strlen(msg->org_path) == 0 || strlen(msg->org_path) >= MAX_FILEPATH_LEN) {
                thumb_err("org_path size is invalid %d", strlen(msg->org_path));
-
+               SAFE_FREE(buf);
                return MS_MEDIA_ERR_SOCKET_RECEIVE;
        }
 
        /* it can be empty string */
        if (strlen(msg->dst_path) >= MAX_FILEPATH_LEN) {
                thumb_err("dst_path size is invalid %d", strlen(msg->dst_path));
-
+               SAFE_FREE(buf);
                return MS_MEDIA_ERR_SOCKET_RECEIVE;
        }
 
        SAFE_FREE(buf);
+
        if (msg->thumb_size < 0) {
                thumb_err("recv data is wrong");
                return MS_MEDIA_ERR_SOCKET_RECEIVE;