diff options
-rw-r--r-- | compress.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |