From bcfe1709fdb883376ad1dc4842f5d3ef87fcb56b Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Tue, 7 Apr 2009 22:20:19 +0000 Subject: [PATCH] Fixes memory leak. Bug #578285. 2009-04-08 Nickolay V. Shmyrev * backend/tiff/tiff2ps.c (tiff2ps_context_new): Fixes memory leak. Bug #578285. svn path=/branches/gnome-2-26/; revision=3576 --- ChangeLog | 6 ++++++ backend/tiff/tiff2ps.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f8fc2b9f..ebe8c373 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-08 Nickolay V. Shmyrev + + * backend/tiff/tiff2ps.c (tiff2ps_context_new): + + Fixes memory leak. Bug #578285. + 2009-04-01 Christian Persch * data/evince.desktop.in.in: Direct bug-buddy bugs to the diff --git a/backend/tiff/tiff2ps.c b/backend/tiff/tiff2ps.c index 45bc5771..43a6cb32 100644 --- a/backend/tiff/tiff2ps.c +++ b/backend/tiff/tiff2ps.c @@ -173,8 +173,11 @@ TIFF2PSContext* tiff2ps_context_new(const gchar *filename) { ctx = g_new0(TIFF2PSContext, 1); ctx->filename = g_strdup(filename); ctx->fd = g_fopen(ctx->filename, "w"); - if (ctx->fd == NULL) + if (ctx->fd == NULL) { + g_free (ctx->filename); + g_free (ctx); return NULL; + } ctx->interpolate = TRUE; /* interpolate level2 image */ ctx->PSavoiddeadzone = TRUE; /* enable avoiding printer deadzone */ return ctx; -- 2.47.1