system-controller: remember to close the lastinfo fd.
authorIsmo Puustinen <ismo.puustinen@intel.com>
Mon, 22 Sep 2014 07:40:44 +0000 (10:40 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Thu, 8 Jan 2015 16:37:17 +0000 (18:37 +0200)
Change-Id: I7250ebe803cfa579bcb2cc8d6d63a33c27b3ef12

src/plugins/system-controller/user/user.c

index 980ea11..eba2886 100644 (file)
@@ -511,9 +511,12 @@ static bool set_lastinfo(lua_State *L, const char *appid, const char *lastinfo,
 
     if (write(fd, lastinfo, lastinfo_len) < 0) {
         mrp_log_error("failed to write to lastinfo file");
+        close(fd);
         return FALSE;
     }
 
+    close(fd);
+
     return TRUE;
 }