[Coverity-112249] Fixed coverity issue. (NEGATIVE_RETURNS) 55/178055/2 accepted/tizen/unified/20180508.071611 submit/tizen/20180508.034954
authorj-h.choi <j-h.choi@samsung.com>
Tue, 8 May 2018 03:22:47 +0000 (12:22 +0900)
committerj-h.choi <j-h.choi@samsung.com>
Tue, 8 May 2018 03:25:00 +0000 (12:25 +0900)
Change-Id: I9810f00e9647010ee5a948ef4d07877fd8fbbdbb

NativeLauncher/launcher/dotnet/dotnet_launcher.cc

index db5c2c5..f3a1056 100644 (file)
@@ -339,7 +339,8 @@ int CoreRuntime::launch(const char* appId, const char* root, const char* path, i
 
        int fd2 = open(root, O_DIRECTORY);
        dup3(fd2, fd, O_CLOEXEC);
-       close(fd2);
+       if (fd2 >= 0)
+               close(fd2);
 
        if (pluginBeforeExecute)
                pluginBeforeExecute();