]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tunelp: free allocation, use xalloc
authorSami Kerola <kerolasa@iki.fi>
Tue, 7 Feb 2012 22:03:55 +0000 (23:03 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 8 Feb 2012 13:29:34 +0000 (14:29 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/tunelp.c

index f59c6dd485923e5691f9cf14fc15e8167dd11ab7..700fe6558ee16dddd95c8d90f9777a68b097b777 100644 (file)
@@ -254,7 +254,7 @@ int main(int argc, char **argv)
        if (optind != argc - 1)
                print_usage(stderr);
 
-       filename = strdup(argv[optind]);
+       filename = xstrdup(argv[optind]);
        fd = open(filename, O_WRONLY | O_NONBLOCK, 0);
        /* Need to open O_NONBLOCK in case ABORTOPEN is already set
         * and printer is off or off-line or in an error condition.
@@ -326,7 +326,7 @@ int main(int argc, char **argv)
                else
                        printf(_("%s using polling\n"), filename);
        }
-
+       free(filename);
        close(fd);
 
        return EXIT_SUCCESS;