disks: Check fopen return value.

This commit is contained in:
Alastair Poole 2019-09-08 22:10:56 +01:00
parent afc9e4cba2
commit 4acdba7ad6
1 changed files with 3 additions and 0 deletions

View File

@ -50,6 +50,9 @@ disk_mount_point_get(const char *path)
char *start, *end;
FILE *f = fopen("/proc/mounts", "r");
if (!f)
return NULL;
while ((fgets(buf, sizeof(buf), f)) != NULL)
{
start = &buf[0];