- If failed to open file at util_file_write_line, it leads to fclose
with null pointer, So it can be lead to segmentation fault
- So fix it with closing null file pointer only file pointer is not null
Change-Id: Ic33b23e6c2fddfad70fd34f12e536d5a25cc69e9
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
_E("Failed to write, path : %s, msg : %s", path, msg);
status = -1;
}
+ fclose(fp);
} else {
_E("Failed to open : %s", path);
status = -1;
}
- fclose(fp);
return status;
}