Fix use-after-free error in wIconStore reported by Coverity
commite828e1c074732c9f670dd621baf1fae59261040f
authorChristophe CURIS <christophe.curis@free.fr>
Fri, 14 May 2021 17:45:56 +0000 (14 19:45 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Tue, 18 May 2021 16:49:17 +0000 (18 17:49 +0100)
treea942659199a71957672080c6fd735a26ec901659
parent97a9300aa47822ea15a8d423b1cdfb2b6d346fc0
Fix use-after-free error in wIconStore reported by Coverity

The function always returns the filename where the icon have been saved,
but in the case where the save operation failed we would free the memory
for that file name, yet still return this pointer like if it were valid.

Took opportunity to remove redundant free(path) which is done a couple
lines later, because redundancy is a source of problem for code
maintenance.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
src/icon.c