Similarly to commit
v8.21-84-g8d2da3f in src/uptime.c
avoid a "definitely lost" error from valgrind. Note this
only happens with pinky when compiled without optimization,
in which case certain paths aren't eliminated casuing
valgrind to trigger the message. Note also that coverity
flags this "resource leak" too.
* src/pinky.c (short_pinky): free utmp_buf for developer builds.
const int argc_names, char *const argv_names[])
{
size_t n_users;
- STRUCT_UTMP *utmp_buf;
+ STRUCT_UTMP *utmp_buf = NULL;
if (read_utmp (filename, &n_users, &utmp_buf, 0) != 0)
error (EXIT_FAILURE, errno, "%s", filename);
scan_entries (n_users, utmp_buf, argc_names, argv_names);
+
+ IF_LINT (free (utmp_buf));
}
static void