compat: add fallback implementation for reallocarray(3)

This commit is contained in:
Đoàn Trần Công Danh
2020-09-15 08:21:50 +07:00
parent 175efaff30
commit 50439c9ca9
6 changed files with 30 additions and 5 deletions

View File

@ -1270,7 +1270,7 @@ array_append (const char ***files,
const char **new_files;
*n_files_allocated = (*n_files_allocated > 0) ? 2 * *n_files_allocated : 4;
new_files = reallocarray (*files, *n_files_allocated, sizeof (**files));
new_files = _sysprof_reallocarray (*files, *n_files_allocated, sizeof (**files));
if (new_files == NULL)
return false;
*files = new_files;