Fixed crash when changing icon to non-existent file
commitbaecab089c053fa070ce962e02e599dd868dd4e5
authorChristophe CURIS <christophe.curis@free.fr>
Mon, 8 Oct 2012 22:20:44 +0000 (9 00:20 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Mon, 8 Oct 2012 23:12:22 +0000 (9 00:12 +0100)
tree574a3905e7f363ccb71f800c3953b3ae52c31565
parente357e94896ba5dfb05dcc22b077a52e66eba4f9f
Fixed crash when changing icon to non-existent file

As found by Rodolfo, a crash could happen when changing an icon to
a non-existent file. From his report:

Steps To Reproduce
1. Open the Settings box, for example for WMDock. (Right click on WMDock, Settings).
2. In the "Icon Image" field, write some characters. For example "asdfasdfasd".
3. Click in "OK". You get "Could not open specified icon file: GNUstep.tiffasdfasdfasd"
4. Hit in "OK"
5. Repeat 2,3,4 some times (sometimes 1, sometimes 2, sometimes 10).

The problem came from freeing the previous icon but not updating
the pointer, so if the new file did not exist it ended up with a
fake-looking icon being used, hence possible crash.

BTS: http://www.kix.es/mantis/view.php?id=1
src/icon.c