diff options
author | yzrh <yzrh@noema.org> | 2022-12-22 11:22:41 +0000 |
---|---|---|
committer | yzrh <yzrh@noema.org> | 2022-12-22 19:48:48 +0000 |
commit | ac3b1dda63944f2cc8caaa52344774255e1956c8 (patch) | |
tree | 2fb8b24fbfe8002f39288926fa06c71100102868 /src/pdf.c | |
parent | 63728e1340a27b7ae629a747229871f3dc670de5 (diff) | |
download | melon-ac3b1dda63944f2cc8caaa52344774255e1956c8.tar.gz melon-ac3b1dda63944f2cc8caaa52344774255e1956c8.tar.zst |
Fix memory leak and data type.
Signed-off-by: yzrh <yzrh@noema.org>
Diffstat (limited to 'src/pdf.c')
-rw-r--r-- | src/pdf.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -120,7 +120,7 @@ pdf_obj_add(pdf_object_t **pdf, int id, if ((*pdf)->stream == NULL) return 1; - memcpy((*pdf)->stream, stream, (*pdf)->stream_size); + memcpy((*pdf)->stream, stream, stream_size); (*pdf)->stream[(*pdf)->stream_size - 1] = '\n'; } else { (*pdf)->stream_size = 0; @@ -249,7 +249,7 @@ pdf_obj_replace(pdf_object_t **pdf, int id, ptr->stream_size = stream_size + 1; ptr->stream = ret; - memcpy(ptr->stream, stream, ptr->stream_size); + memcpy(ptr->stream, stream, stream_size); ptr->stream[ptr->stream_size - 1] = '\n'; } |