Change-Id: I8fc3c40c8a2cf3d9e5fb840796d0f0bf0b66a072
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
}
fd = fileno(fp);
+ if (fd == -1) {
+ connman_error("fp is not a valid stream");
+ fclose(fp);
+ return NULL;
+ }
+
fstat(fd, &st);
file_size = st.st_size;
file_buff = g_try_malloc0(sizeof(char)*st.st_size);
}
fd = fileno(fp);
+ if (fd == -1) {
+ connman_error("fp is not a valid stream");
+ fclose(fp);
+ return NULL;
+ }
+
fstat(fd, &st);
file_size = st.st_size;
file_buff = g_try_malloc0(sizeof(char)*st.st_size);