Fixed svace issue.(HANDLE_LEAK)
authorJongHeon Choi <j-h.choi@samsung.com>
Mon, 27 Jun 2016 01:11:02 +0000 (10:11 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Mon, 27 Jun 2016 01:11:02 +0000 (10:11 +0900)
runtime/browser/prelauncher.cc

index 2f64fbb..278e850 100755 (executable)
@@ -45,8 +45,10 @@ int SmackLabelSetForTask(const std::string& label) {
   if (fd < 0)
     return -1;
   ret = write(fd, label.c_str(), label.length());
-  if (syncfs(fd) < 0)
+  if (syncfs(fd) < 0) {
+    close(fd);
     return -1;
+  }
   close(fd);
   return (ret < 0) ? -1 : 0;
 }