]> git.tuebingen.mpg.de Git - adu.git/blobdiff - adu.c
remove memory leak in scan_dir()
[adu.git] / adu.c
diff --git a/adu.c b/adu.c
index 0e32f8564079b4d5eac0c9302f5e95a248d64062..03df3e1625984fff168dceaf32b7f6981b1cb05f 100644 (file)
--- a/adu.c
+++ b/adu.c
@@ -414,8 +414,8 @@ int scan_dir(char *dirname)
                m = s.st_mode;
                if (!S_ISREG(m) && !S_ISDIR(m))
                        continue;
-               tmp = make_message("%s/%s", dirname, entry->d_name);
                if (S_ISDIR(m)) {
+                       tmp = make_message("%s/%s", dirname, entry->d_name);
                        ret = scan_dir(tmp);
                        free(tmp);
                        if (ret < 0)
@@ -532,7 +532,7 @@ static int print_id_stats(struct osl_row *row, __a_unused void *data)
                return ret;
        files = *(uint64_t *)obj.data;
 
-       printf("%u\t%llu%llu\n", (unsigned)uid, (long long unsigned)files,
+       printf("%u\t%llu\t%llu\n", (unsigned)uid, (long long unsigned)files,
                (long long unsigned)bytes);
        return 1;
 }