rootdev: Fix memory leak

match_sysfs_device allocates a struct dirent that was used with
readdir_r.  When the function was converted to use readdir, the malloc
wasn't removed, so this is now a memory leak.  Remove the malloc
entirely, since readdir returns a pointer to its own memory.

BUG=b:225008839
TEST=FEATURES=test emerge-octopus rootdev

Change-Id: I20325e8b4baebca7ea358ccd804f761aeda2bfa1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/rootdev/+/3804964
Tested-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Commit-Queue: Benjamin Gordon <bmgordon@chromium.org>
1 file changed