diff options
Diffstat (limited to 'w3mimgdisplay.c')
-rw-r--r-- | w3mimgdisplay.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/w3mimgdisplay.c b/w3mimgdisplay.c index 5486a47..ccfa373 100644 --- a/w3mimgdisplay.c +++ b/w3mimgdisplay.c @@ -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; } |