aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-03-28 15:36:42 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-03-29 10:15:29 +0000
commit286aff8a81d0c313cc763494a0bd0585db9b25dd (patch)
tree708fb729741cbf11e30ac5fc0072baf18de842ea
parentFix mistake of unescape spaces for _doFileCopy (diff)
downloadw3m-286aff8a81d0c313cc763494a0bd0585db9b25dd.tar.gz
w3m-286aff8a81d0c313cc763494a0bd0585db9b25dd.zip
Fix realloc mistake for DrawImage
Diffstat (limited to '')
-rw-r--r--w3mimgdisplay.c4
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;
}