#include <assert.h>
#include <elf.h>
#include <endian.h>
-#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
*array = a = malloc(total_size);
if (*array == NULL)
- return -errno;
+ return -ENOMEM;
s = (char *)(a + count + 1);
memcpy(s, strings, size);
*array = a = malloc(sizeof(struct kmod_modversion) * count);
if (*array == NULL)
- return -errno;
+ return -ENOMEM;
for (i = 0, off = sec_off; i < count; i++, off += verlen) {
uint64_t crc = elf_get_uint(elf, off, crclen);
changed = memdup(elf->memory, elf->size);
if (changed == NULL)
- return -errno;
+ return -ENOMEM;
ELFDBG(elf, "copied memory to allow writing.\n");
*array = a = malloc(total_size);
if (*array == NULL)
- return -errno;
+ return -ENOMEM;
last = 0;
for (i = 0, count = 0; i < size; i++) {
*array = a = malloc(sizeof(struct kmod_modversion) * count);
if (*array == NULL)
- return -errno;
+ return -ENOMEM;
count = 0;
str_off = str_sec_off;
if (*array == NULL) {
free(visited_versions);
free(symcrcs);
- return -errno;
+ return -ENOMEM;
}
count = 0;
size_t write_size = BUFSIZ - strm->avail_out;
char *tmp = realloc(p, total + write_size);
if (tmp == NULL) {
- ret = -errno;
+ ret = -ENOMEM;
goto out;
}
memcpy(tmp + total, out_buf, write_size);
size_t size = new_total * sizeof(struct hash_entry);
struct hash_entry *tmp = realloc(bucket->entries, size);
if (tmp == NULL)
- return -errno;
+ return -ENOMEM;
bucket->entries = tmp;
bucket->total = new_total;
}
size_t size = new_total * sizeof(struct hash_entry);
struct hash_entry *tmp = realloc(bucket->entries, size);
if (tmp == NULL)
- return -errno;
+ return -ENOMEM;
bucket->entries = tmp;
bucket->total = new_total;
}