hust testsuite: fix a false positive
[oweals/busybox.git] / miscutils / last_fancy.c
index 8194e31b5675e51d0db57e7601fbabb03745086a..e56e0ba85995772ecf5f28e3ea33598e0ee4d223 100644 (file)
@@ -233,7 +233,7 @@ int last_main(int argc UNUSED_PARAM, char **argv)
                                break;
                        }
                        /* add_entry */
-                       llist_add_to(&zlist, memcpy(xmalloc(sizeof(ut)), &ut, sizeof(ut)));
+                       llist_add_to(&zlist, xmemdup(&ut, sizeof(ut)));
                        break;
                case USER_PROCESS: {
                        int show;
@@ -275,7 +275,7 @@ int last_main(int argc UNUSED_PARAM, char **argv)
                                show_entry(&ut, state, boot_time);
                        }
                        /* add_entry */
-                       llist_add_to(&zlist, memcpy(xmalloc(sizeof(ut)), &ut, sizeof(ut)));
+                       llist_add_to(&zlist, xmemdup(&ut, sizeof(ut)));
                        break;
                }
                }