From 6d46ef5c157b87f6a44e009b4fc7f60078ecce59 Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 27 Nov 2013 07:06:18 +0000 Subject: fixed fp and memory leaks. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3300 ee746299-78ed-0310-b773-934348b2243d --- src/jpilot.c | 3 +++ src/template.c | 2 ++ 2 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/jpilot.c b/src/jpilot.c index e0161cc1..ca8e391b 100644 --- a/src/jpilot.c +++ b/src/jpilot.c @@ -849,6 +849,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) { return MGU_ERROR_READ; } if (feof(in)) { + fclose(in); return MGU_EOF; } } @@ -866,6 +867,8 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) { break; } if (feof(in)) { + free_mem_rec_header(&mem_rh); + fclose(in); return MGU_EOF; } } diff --git a/src/template.c b/src/template.c index e121bd3b..3e8781fd 100644 --- a/src/template.c +++ b/src/template.c @@ -73,6 +73,7 @@ static Template *template_load(gchar *filename, guint tmplid) if (!tmpl->name) { g_warning("wrong template format\n"); template_free(tmpl); + fclose(fp); return NULL; } @@ -80,6 +81,7 @@ static Template *template_load(gchar *filename, guint tmplid) if (!tmpl->value) { g_warning("cannot read template body\n"); template_free(tmpl); + fclose(fp); return NULL; } fclose(fp); -- cgit v1.2.3