Skip to content

Commit

Permalink
lib/inflate.c: handle failed malloc()
Browse files Browse the repository at this point in the history
lib/inflate.c (inflate_dynamic): Don't deref NULL upon failed malloc.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jim Meyering authored and Linus Torvalds committed Apr 29, 2008
1 parent cd6fda3 commit 22caa04
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,9 @@ DEBG("<dyn");
ll = malloc(sizeof(*ll) * (286+30)); /* literal/length and distance code lengths */
#endif

if (ll == NULL)
return 1;

/* make local bit buffer */
b = bb;
k = bk;
Expand Down

0 comments on commit 22caa04

Please sign in to comment.