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:
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "load_driver_settings.h"
|
#include "load_driver_settings.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@@ -29,7 +30,8 @@ load_driver_settings_file(Directory* directory, const char* name)
|
|||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
struct stat stat;
|
struct stat stat;
|
||||||
fstat(fd, &stat);
|
if (fstat(fd, &stat) < 0)
|
||||||
|
return errno;
|
||||||
|
|
||||||
char* buffer = (char*)kernel_args_malloc(stat.st_size + 1);
|
char* buffer = (char*)kernel_args_malloc(stat.st_size + 1);
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user