summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compress.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compress.c b/compress.c
index 3accc9a..59bd35c 100644
--- a/compress.c
+++ b/compress.c
@@ -29,7 +29,8 @@ static ssize_t read_data(FILE *in, uint8_t **pdata) {
if(ferror_unlocked(in)) goto fail;
uint8_t *r = realloc(data, len);
- if(r) data = r;
+ if(len && !r) goto fail;
+ data = r;
*pdata = data;
return len;