Fix static analysis issue
[platform/core/appfw/app2sd.git] / plugin / app2sd / server / app2sd_internals_utils.c
index 59219e6..c3df8cb 100644 (file)
@@ -348,8 +348,10 @@ static int generate_random_num(unsigned short* buf, int len) {
        if (fd < 0)
                return -1;
 
-       if (read(fd, buf, len) < 0)
-               return -1;
+       if (read(fd, buf, len) < 0) {
+                close(fd);
+                return -1;
+        }
 
        close(fd);