]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: Fix memory leak in do_ncheck()'s error path
authorManish Katiyar <mkatiyar@gmail.com>
Wed, 3 Sep 2008 05:53:53 +0000 (11:23 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 5 Sep 2008 11:50:44 +0000 (07:50 -0400)
Also the progname printed as "ncheck" instead of "do_ncheck" to be
consistent with the other error messages in debugfs.

Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/ncheck.c

index 3381dd97ecb39daf862d1ff120e2263a6cacacbc..22529c4052d507f772a84ee90c6b1db903549d5c 100644 (file)
@@ -76,7 +76,7 @@ void do_ncheck(int argc, char **argv)
 
        iw.iarray = malloc(sizeof(struct inode_info) * argc);
        if (!iw.iarray) {
-               com_err("do_ncheck", ENOMEM,
+               com_err("ncheck", ENOMEM,
                        "while allocating inode info array");
                return;
        }
@@ -86,7 +86,7 @@ void do_ncheck(int argc, char **argv)
                iw.iarray[i-1].ino = strtol(argv[i], &tmp, 0);
                if (*tmp) {
                        com_err(argv[0], 0, "Bad inode - %s", argv[i]);
-                       return;
+                       goto error_out;
                }
        }