Change-Id: I561f537c292f24af2e9956a7694e3868ee0ccd32
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
return NULL;
}
- fstat(fd, &st);
+ if (fstat(fd, &st) != 0) {
+ connman_error("fstat failed");
+ fclose(fp);
+ return NULL;
+ }
+
file_size = st.st_size;
file_buff = g_try_malloc0(sizeof(char)*st.st_size);
if (file_buff == NULL) {
return NULL;
}
- fstat(fd, &st);
+ if (fstat(fd, &st) != 0) {
+ connman_error("fstat failed");
+ fclose(fp);
+ return NULL;
+ }
+
file_size = st.st_size;
file_buff = g_try_malloc0(sizeof(char)*st.st_size);
if (file_buff == NULL) {