]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blkid: fix double free [coverity scan]
authorKarel Zak <kzak@redhat.com>
Fri, 11 Mar 2011 15:12:20 +0000 (16:12 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 11 Mar 2011 15:12:20 +0000 (16:12 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/blkid.c

index 23619bd8be244b96448398e31cecbd8290b13521..ca8083bfa55c28bcf9ab4a23102932ae7e93959f 100644 (file)
@@ -375,10 +375,9 @@ static int append_str(char **res, size_t *sz, const char *a, const char *b)
                return -1;
 
        str = realloc(str, len + 1);
-       if (!str) {
-               free(*res);
+       if (!str)
                return -1;
-       }
+
        *res = str;
        str += *sz;