Reviewed-by: "Evgeny Grin (Karlson2k)" <k2k@drgrin.dev>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
#include "string/strcmp/strneq.h"
#include "string/strcmp/strprefix.h"
#include "string/strcpy/strncpy.h"
+#include "string/strdup/memdup.h"
#include "string/strdup/strdup.h"
#include "string/strdup/strndup.h"
if (NULL == ut)
ut = ut_by_pid ?: ut_by_line;
- if (NULL != ut) {
- struct utmpx *ut_copy;
-
- ut_copy = malloc_T(1, struct utmpx);
- if (ut_copy != NULL)
- *ut_copy = *ut;
- ut = ut_copy;
- }
+ if (NULL != ut)
+ ut = memdup_T(ut, struct utmpx);
free(ut_by_line);
free(ut_by_pid);