[patch] applied: sokoban-malloc

0 views
Skip to first unread message

9cha...@cat-v.org

unread,
May 11, 2008, 6:37:17 PM5/11/08
to plan9c...@googlegroups.com
Created May 11 16:37 by none
Processed May 11 22:37 by geoff

properly check malloc return value

--
/sys/src/games/sokoban/route.c
route.c.orig:85,91 - /n/sources/patch/applied/sokoban-malloc/route.c:85,91
Walk *w;

w = malloc(sizeof(Walk));
- if (w->route == nil)
+ if (w == nil)
sysfatal("cannot allocate walk");
memset(w, 0, sizeof(Walk));
return w;

Reply all
Reply to author
Forward
0 new messages