... | ... |
@@ -313,7 +313,10 @@ int unrar_open(int fd, const char *dirname, unrar_state_t *state) |
313 | 313 |
unrar_dbgmsg("UNRAR: Offset: %x\n", offset); |
314 | 314 |
if(offset < 0){ |
315 | 315 |
unrar_dbgmsg("UNRAR: Error Offset: %d\n", offset); |
316 |
- offset = 0; |
|
316 |
+ free(main_hdr); |
|
317 |
+ free(state->comment_dir); |
|
318 |
+ free(unpack_data); |
|
319 |
+ return UNRAR_ERR; |
|
317 | 320 |
} |
318 | 321 |
comment_header = read_header(fd, COMM_HEAD); |
319 | 322 |
if(comment_header) { |