diff --git a/libscan/arc/arc.c b/libscan/arc/arc.c index 81d5836..04c7179 100644 --- a/libscan/arc/arc.c +++ b/libscan/arc/arc.c @@ -140,8 +140,8 @@ scan_code_t parse_archive(scan_arc_ctx_t *ctx, vfile_t *f, document_t *doc) { memcpy(sub_job->parent, doc->uuid, sizeof(uuid_t)); while (archive_read_next_header(a, &entry) == ARCHIVE_OK) { - sub_job->info = *archive_entry_stat(entry); - if (S_ISREG(sub_job->info.st_mode)) { + sub_job->vfile.info = *archive_entry_stat(entry); + if (S_ISREG(sub_job->vfile.info.st_mode)) { sprintf(sub_job->filepath, "%s#/%s", f->filepath, archive_entry_pathname(entry)); sub_job->base = (int) (strrchr(sub_job->filepath, '/') - sub_job->filepath) + 1; diff --git a/libscan/cbr/cbr.c b/libscan/cbr/cbr.c index 56e0049..17bef6e 100644 --- a/libscan/cbr/cbr.c +++ b/libscan/cbr/cbr.c @@ -46,4 +46,5 @@ void parse_cbr(scan_cbr_ctx_t *ctx, vfile_t *f, document_t *doc) { parse_ebook_mem(&ctx->ebook_ctx, out_buf, out_buf_used, "application/x-cbz", doc); doc->mime = ctx->cbr_mime; free(out_buf); + free(buf); } diff --git a/libscan/font/font.c b/libscan/font/font.c index dad74ce..942aa57 100644 --- a/libscan/font/font.c +++ b/libscan/font/font.c @@ -150,6 +150,7 @@ void parse_font(scan_font_ctx_t *ctx, vfile_t *f, document_t *doc) { FT_Error err = FT_New_Memory_Face(ft_lib, (unsigned char *) buf, buf_len, 0, &face); if (err != 0) { CTX_LOG_ERRORF(doc->filepath, "(font.c) FT_New_Memory_Face() returned error code [%d] %s", err, FT_Error_String(err)) + free(buf); return; } @@ -172,6 +173,7 @@ void parse_font(scan_font_ctx_t *ctx, vfile_t *f, document_t *doc) { if (ctx->enable_tn == TRUE) { FT_Done_Face(face); + free(buf); return; } @@ -182,6 +184,7 @@ void parse_font(scan_font_ctx_t *ctx, vfile_t *f, document_t *doc) { if (err != 0) { CTX_LOG_WARNINGF(doc->filepath, "(font.c) FT_Set_Pixel_Sizes() returned error code [%d] %s", err, FT_Error_String(err)) FT_Done_Face(face); + free(buf); return; } @@ -228,6 +231,7 @@ void parse_font(scan_font_ctx_t *ctx, vfile_t *f, document_t *doc) { free(bitmap); FT_Done_Face(face); + free(buf); } void cleanup_font() { diff --git a/libscan/scan.h b/libscan/scan.h index 5553d3b..be2c1bd 100644 --- a/libscan/scan.h +++ b/libscan/scan.h @@ -126,7 +126,6 @@ typedef struct vfile { typedef struct parse_job_t { int base; int ext; - struct stat info; struct vfile vfile; uuid_t parent; char filepath[1];