mirror of
https://github.com/hashcat/hashcat
synced 2024-11-20 23:27:31 +01:00
Update gzlog.c
fix memory leak
This commit is contained in:
parent
62f80e798e
commit
4dc1b2b0cd
3
deps/zlib/examples/gzlog.c
vendored
3
deps/zlib/examples/gzlog.c
vendored
@ -757,12 +757,15 @@ local int log_recover(struct log *log, int op)
|
|||||||
}
|
}
|
||||||
if ((fd = open(log->path, O_RDONLY, 0)) < 0) {
|
if ((fd = open(log->path, O_RDONLY, 0)) < 0) {
|
||||||
log_log(log, op, ".add file read failure");
|
log_log(log, op, ".add file read failure");
|
||||||
|
if (data != NULL)
|
||||||
|
free(data);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = (size_t)read(fd, data, len) != len;
|
ret = (size_t)read(fd, data, len) != len;
|
||||||
close(fd);
|
close(fd);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
log_log(log, op, ".add file read failure");
|
log_log(log, op, ".add file read failure");
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
log_log(log, op, "loaded .add file");
|
log_log(log, op, "loaded .add file");
|
||||||
|
Loading…
Reference in New Issue
Block a user