]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/colors: fix double free on error path
authorAndreas Henriksson <andreas@fatal.se>
Wed, 19 Nov 2014 11:03:35 +0000 (12:03 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Nov 2014 13:18:55 +0000 (14:18 +0100)
commita72de3cf64e740624f579bc25e7f003be2d66172
tree9b87a8e5b46f685bc1dab4517669adf68424c370
parentcd2876d252215fb3fbe46f787cb37cd4fbd64e53
lib/colors: fix double free on error path

The error path was a bit unclear on the semantics. The seq argument
would get freed but not the name argument. Then the caller frees
them both when the function returns an error.
This fixes the problem my making the function not touch the arguments
unless we're going to return success. Also improve the description
for this function to make it more obvious what the callers should expect.

Addresses: CID#77487 (on scan.coverity.com for JIghtuse/util-linux)
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
lib/colors.c