summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2020-06-27 20:24:31 -0400
committerFranklin Wei <franklin@rockbox.org>2020-06-27 20:28:46 -0400
commit7da8137bdb333d4f8424d098d90331e1fb83fb45 (patch)
treefe6bd0e5c535cafa61a0cf06740b02f9ce1cd6f0 /apps
parentc02a9c5ab3b0d2c4a6d9fb0e558fa5e8e9271770 (diff)
downloadrockbox-7da8137bdb333d4f8424d098d90331e1fb83fb45.tar.gz
rockbox-7da8137bdb333d4f8424d098d90331e1fb83fb45.tar.bz2
rockbox-7da8137bdb333d4f8424d098d90331e1fb83fb45.zip
puzzles: fix crash when loading a corrupt save
I misread the documentation here, thinking that the pointer would be set to *point to* a null byte, not to a null pointer itself. [1] [1]: https://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/midend.html#identify-game Change-Id: I9b76bba9b1611dfd8e05d076a69f7554b5b74c53
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/puzzles/rockbox.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
index a10bf7dd5c..eabe739657 100644
--- a/apps/plugins/puzzles/rockbox.c
+++ b/apps/plugins/puzzles/rockbox.c
@@ -3201,9 +3201,8 @@ static bool load_game(void)
char *game;
const char *ret = identify_game(&game, read_wrapper, (void*)fd);
- if(!*game && ret)
+ if(!game && ret)
{
- sfree(game);
rb->splash(HZ, ret);
rb->close(fd);
return false;