Check fstat() return value (CID 2514).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40072 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2011-01-02 22:20:18 +00:00
parent db03311342
commit 3e9f742d23

View File

@ -7,6 +7,7 @@
#include "load_driver_settings.h"
#include <errno.h>
#include <string.h>
#include <unistd.h>
@ -29,7 +30,8 @@ load_driver_settings_file(Directory* directory, const char* name)
return fd;
struct stat stat;
fstat(fd, &stat);
if (fstat(fd, &stat) < 0)
return errno;
char* buffer = (char*)kernel_args_malloc(stat.st_size + 1);
if (buffer == NULL)