summaryrefslogtreecommitdiff
path: root/libspectre/ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'libspectre/ps.c')
-rw-r--r--libspectre/ps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libspectre/ps.c b/libspectre/ps.c
index 4fe3b23..3e15598 100644
--- a/libspectre/ps.c
+++ b/libspectre/ps.c
@@ -588,7 +588,7 @@ psscan(FILE *file, const char *filename, int scanstyle)
// fall-through
case 1:
if (maxpages > 0) {
- PS_free(doc->pages);
+ PS_free(doc->pages);
doc->pages = (struct page *) PS_calloc(maxpages,
sizeof(struct page));
if (!doc->pages)
@@ -1002,6 +1002,7 @@ psscan(FILE *file, const char *filename, int scanstyle)
if (maxpages == 0) {
maxpages = 1;
+ PS_free(doc->pages);
doc->pages = (struct page *) PS_calloc(maxpages, sizeof(struct page));
CHECK_MALLOCED(doc->pages);
}