fsstress: Eliminate valgrind noise
authorAri Sundholm <ari@tuxera.com>
Wed, 20 Dec 2017 17:00:10 +0000 (19:00 +0200)
committerEryu Guan <eguan@redhat.com>
Sun, 24 Dec 2017 13:30:58 +0000 (21:30 +0800)
This patch plugs what we think are the remaining sources of valgrind
noise we found when running fsstress under valgrind.  The noise is
caused by memory being left unfreed before process termination.

Signed-off-by: Ari Sundholm <ari@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ltp/fsstress.c

index 96f48b1c27f2f047c15fc4294653c0ac4ddf1c61..13d5dd54b1e0f2a9379fe585234a4113f17f9429 100644 (file)
@@ -614,6 +614,9 @@ int main(int argc, char **argv)
                                return 1;
                        }
 #endif
+
+                       cleanup_flist();
+                       free(freq_table);
                        return 0;
                }
        }
@@ -640,6 +643,7 @@ int main(int argc, char **argv)
                close(fd);
        }
 
+       free(freq_table);
        unlink(buf);
        return 0;
 }
@@ -997,6 +1001,7 @@ doproc(void)
        }
 errout:
        chdir("..");
+       free(homedir);
        if (cleanup) {
                sprintf(cmd, "rm -rf %s", buf);
                system(cmd);