]> www.infradead.org Git - mtd-utils.git/commitdiff
fs-tests: integck: do not forget to free mount_opts
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 20 Apr 2011 13:14:12 +0000 (16:14 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 22 Apr 2011 11:29:53 +0000 (14:29 +0300)
The test forgets to free the args.mount_opts string on exit - fix this.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
tests/fs-tests/integrity/integck.c

index 6de4a4252bd3afa54390f4de5dbcddd2ea5c7367..4b9b0f0254945b0339022e16b49bb77cc8dc70ab 100644 (file)
@@ -2416,8 +2416,7 @@ static void parse_mount_options(const char *mount_opts)
         * so duplicate it.
         */
        tmp = dup_string(mount_opts);
-       p = opts = calloc(1, strlen(mount_opts) + 1);
-       CHECK(opts != NULL);
+       p = opts = zalloc(strlen(mount_opts) + 1);
 
        opt = strtok(tmp, ",");
        while (opt) {
@@ -2719,6 +2718,7 @@ int main(int argc, char *argv[])
 
 out_free:
        free(random_name_buf);
+       free(fsinfo.mount_opts);
        free(fsinfo.mount_point);
        free(fsinfo.fstype);
        free(fsinfo.fsdev);