Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2007-02-05 11:27:34 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2007-02-05 11:27:34 (GMT)
commitbee9c00ae51bae72e3c6fe4e46ce9b5fef9f9436 (patch)
tree198b639993f50724c60b8a5d5b204911a2af8f29 /backend
parent5708615a04a6eba7f429ee977dbbe9583cbefa6f (diff)
Fix memory leak.
2007-02-05 Carlos Garcia Campos <carlosgc@gnome.org> * backend/ps/ps.c: (psscan): Fix memory leak. svn path=/trunk/; revision=2295
Diffstat (limited to 'backend')
-rw-r--r--backend/ps/ps.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/ps/ps.c b/backend/ps/ps.c
index b4b54e0..37b7f7e 100644
--- a/backend/ps/ps.c
+++ b/backend/ps/ps.c
@@ -264,7 +264,7 @@ psscan(FILE * file, int respect_eof, const gchar * fname)
rewind(file);
- fd = ps_io_init(file);
+ fd = ps_io_init(file);
if (!readline(fd, &line, &position, &line_len)) {
fprintf(stderr, "Warning: empty file.\n");
ps_io_exit(fd);
@@ -280,6 +280,7 @@ psscan(FILE * file, int respect_eof, const gchar * fname)
&& (line[0] != '%')) ;
if(line[0] != '%') {
g_print("psscan error: input files seems to be a PJL file.\n");
+ ps_io_exit(fd);
return (NULL);
}
}
@@ -326,6 +327,7 @@ psscan(FILE * file, int respect_eof, const gchar * fname)
doc = g_new0(struct document, 1);
doc->default_page_orientation = GTK_GS_ORIENTATION_NONE;
doc->orientation = GTK_GS_ORIENTATION_NONE;
+ ps_io_exit(fd);
return (doc);
}
@@ -1137,6 +1139,7 @@ newpage:
}
}
#endif
+ ps_io_exit(fd);
return doc;
}