The 'tool' function here is set equal to 'priv->tool' earlier in this function. If an error condition occurs, the tool can be freed both here and in wcmFree (via wcmUninit).
It should be safe to postpone this free() until wcmFree to be freed along with the rest of the memory allocated in wcmAllocate. There should be no leak (wcmUninit will be called on failure) and any code relying on priv->tool being a valid pointer after the failure of wcmPreInitParseOptions is already broken. Signed-off-by: Jason Gerecke <killert...@gmail.com> --- src/wcmValidateDevice.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index 748007b..a296984 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -934,7 +934,6 @@ Bool wcmPreInitParseOptions(InputInfoPtr pInfo, Bool is_primary, return TRUE; error: - free(tool); return FALSE; } -- 1.7.12 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel