Fix a few minor bugs that cppcheck complained about.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
}
if (printed)
fprintf(f, "\n");
+ ext2fs_extent_free(handle);
}
static void dump_inline_data(FILE *out, const char *prefix, ext2_ino_t inode_num)
tz = ss_safe_getenv("TZ");
if (!tz)
tz = "";
- do_gmt = !strcmp(tz, "GMT") | !strcmp(tz, "GMT0");
+ do_gmt = !strcmp(tz, "GMT") || !strcmp(tz, "GMT0");
}
return asctime((do_gmt) ? gmtime(&t) : localtime(&t));
goto errout;
uuid_unparse(fs->super->s_uuid, uuid);
sprintf(fn, "%s/%s-icount-XXXXXX", tdb_dir, uuid);
- icount->tdb_fn = fn;
save_umask = umask(077);
fd = mkstemp(fn);
if (fd < 0) {
retval = errno;
+ ext2fs_free_mem(&fn);
goto errout;
}
+ icount->tdb_fn = fn;
umask(save_umask);
/*
* This is an overestimate of the size that we will need; the
#include <fcntl.h>
#include <time.h>
#include <utime.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>