mirror of https://github.com/vitalif/e2fsprogs
[VALGRIND] Fix memory leak in libblkid (blkid_get_devname)
Nyah, nyah, Coverity didn't find this one. :-) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>bitmap-optimize
parent
61bf36ef2d
commit
5f7fe7fe0e
|
@ -1,3 +1,7 @@
|
|||
2007-03-21 Theodore Tso <tytso@mit.edu>
|
||||
|
||||
* resolve.c (blkid_get_devname): Fix memory leak.
|
||||
|
||||
2007-03-18 Theodore Tso <tytso@mit.edu>
|
||||
|
||||
* tag.c (blkid_dev_has_tag): Allow value to be NULL, in which case
|
||||
|
|
|
@ -79,22 +79,24 @@ char *blkid_get_devname(blkid_cache cache, const char *token,
|
|||
value ? value : "", cache ? "in cache" : "from disk"));
|
||||
|
||||
if (!value) {
|
||||
if (!strchr(token, '='))
|
||||
return blkid_strdup(token);
|
||||
if (!strchr(token, '=')) {
|
||||
ret = blkid_strdup(token);
|
||||
goto out;
|
||||
}
|
||||
blkid_parse_tag_string(token, &t, &v);
|
||||
if (!t || !v)
|
||||
goto errout;
|
||||
goto out;
|
||||
token = t;
|
||||
value = v;
|
||||
}
|
||||
|
||||
dev = blkid_find_dev_with_tag(c, token, value);
|
||||
if (!dev)
|
||||
goto errout;
|
||||
goto out;
|
||||
|
||||
ret = blkid_strdup(blkid_dev_devname(dev));
|
||||
|
||||
errout:
|
||||
out:
|
||||
if (t)
|
||||
free(t);
|
||||
if (v)
|
||||
|
|
Loading…
Reference in New Issue