Log "out of memory" error message in case of OOM
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
if (!stat(path, &st) && S_ISDIR(st.st_mode)) {
module_folders = realloc(module_folders, sizeof(p) * (n + 2));
if (!stat(path, &st) && S_ISDIR(st.st_mode)) {
module_folders = realloc(module_folders, sizeof(p) * (n + 2));
+ if (!module_folders) {
+ ULOG_ERR("out of memory\n");
module_folders[n++] = strdup(path);
}
module_folders[n++] = strdup(path);
}
}
data = malloc(s.st_size);
}
data = malloc(s.st_size);
+ if (!data) {
+ ULOG_ERR("out of memory\n");
if (read(fd, data, s.st_size) == s.st_size) {
ret = syscall(__NR_init_module, data, (unsigned long) s.st_size, options);
if (read(fd, data, s.st_size) == s.st_size) {
ret = syscall(__NR_init_module, data, (unsigned long) s.st_size, options);
options = malloc(len);
if (!options) {
options = malloc(len);
if (!options) {
+ ULOG_ERR("out of memory\n");
dir = argv[1];
path = malloc(strlen(dir) + 2);
dir = argv[1];
path = malloc(strlen(dir) + 2);
+ if (!path) {
+ ULOG_ERR("out of memory\n");
strcpy(path, dir);
strcat(path, "*");
strcpy(path, dir);
strcat(path, "*");