This function already returned NULL on some errors. It didn't make any
sense to exit(3) on allocation failure. Instead, just return NULL.
Reviewed-by: "Evgeny Grin (Karlson2k)" <k2k@drgrin.dev>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
if (NULL != ut) {
struct utmpx *ut_copy;
- ut_copy = xmalloc_T(1, struct utmpx);
- memcpy(ut_copy, ut, sizeof(*ut));
+ ut_copy = malloc_T(1, struct utmpx);
+ if (ut_copy != NULL)
+ memcpy(ut_copy, ut, sizeof(*ut));
ut = ut_copy;
}