Commit 22caa041 authored by Jim Meyering's avatar Jim Meyering Committed by Linus Torvalds

lib/inflate.c: handle failed malloc()

lib/inflate.c (inflate_dynamic): Don't deref NULL upon failed malloc.
Signed-off-by: default avatarJim Meyering <meyering@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cd6fda36
...@@ -811,6 +811,9 @@ DEBG("<dyn"); ...@@ -811,6 +811,9 @@ DEBG("<dyn");
ll = malloc(sizeof(*ll) * (286+30)); /* literal/length and distance code lengths */ ll = malloc(sizeof(*ll) * (286+30)); /* literal/length and distance code lengths */
#endif #endif
if (ll == NULL)
return 1;
/* make local bit buffer */ /* make local bit buffer */
b = bb; b = bb;
k = bk; k = bk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment