diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-03-28 15:36:42 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-03-29 10:15:29 +0000 |
commit | 286aff8a81d0c313cc763494a0bd0585db9b25dd (patch) | |
tree | 708fb729741cbf11e30ac5fc0072baf18de842ea /w3mimgdisplay.c | |
parent | Fix mistake of unescape spaces for _doFileCopy (diff) | |
download | w3m-286aff8a81d0c313cc763494a0bd0585db9b25dd.tar.gz w3m-286aff8a81d0c313cc763494a0bd0585db9b25dd.zip |
Fix realloc mistake for DrawImage
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; } |