]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/colors: remove memory leak
authorSami Kerola <kerolasa@iki.fi>
Wed, 16 Jul 2014 20:54:56 +0000 (21:54 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 17 Jul 2014 12:00:55 +0000 (14:00 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/colors.c

index cb342a0e2cca099a332c7b5b92d110740fc6145e..8de1d2fbe27a77bbd9d03215e7f653cf792be0a8 100644 (file)
@@ -425,9 +425,9 @@ static int colors_add_scheme(struct ul_color_ctl *cc,
                return -EINVAL;
 
        rc = cn_sequence(seq0, &seq);
+       free(seq0);
        if (rc)
                return rc;
-       free(seq0);
 
        /* convert logical name (e.g. "red") to real ESC code */
        if (isalpha(*seq)) {