Skip to content

Commit

Permalink
Fix realloc mistake for DrawImage
Browse files Browse the repository at this point in the history
  • Loading branch information
tats committed Mar 29, 2016
1 parent 15b6fb0 commit 286aff8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions w3mimgdisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ DrawImage(char *buf, int redraw)
maxImage = n + 1;
imageBuf = (W3MImage *) realloc((void *)imageBuf,
sizeof(W3MImage) * maxImage);
if (imageBuf == NULL) {
fprintf(stderr, "Out of memory\n");
exit(1);
}
for (; i < maxImage; i++)
imageBuf[i].pixmap = NULL;
}
Expand Down

0 comments on commit 286aff8

Please sign in to comment.