You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
401 B
17 lines
401 B
6 years ago
|
diff --git a/lib/paper.c b/lib/paper.c
|
||
|
index 57db599..8817aea 100644
|
||
|
--- a/lib/paper.c
|
||
|
+++ b/lib/paper.c
|
||
|
@@ -211,7 +211,10 @@ PAPERSIZEVAR, fall-back to the old behaviour.
|
||
|
fclose(ps);
|
||
|
|
||
|
paperstr = malloc((strlen(papername) + 1) * sizeof(char));
|
||
|
- if (! paperstr) return 0;
|
||
|
+ if (! paperstr) {
|
||
|
+ free(papername);
|
||
|
+ return 0;
|
||
|
+ }
|
||
|
|
||
|
strcpy(paperstr, papername);
|
||
|
free(papername);
|