From: Ricardo Mones Date: Sat, 6 Jun 2015 11:52:23 +0000 (+0200) Subject: Fix low probability resource leak X-Git-Tag: 3.12.0~124 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=8d39c742f618aa562874fe08ab389ef1a60da0be Fix low probability resource leak --- diff --git a/src/plugins/libravatar/libravatar_missing.c b/src/plugins/libravatar/libravatar_missing.c index c56ef32bf..ee28fde8a 100644 --- a/src/plugins/libravatar/libravatar_missing.c +++ b/src/plugins/libravatar/libravatar_missing.c @@ -1,7 +1,7 @@ /* * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2014 Hiroyuki Yamamoto and the Claws Mail Team - * Copyright (C) 2014 Ricardo Mones + * Copyright (C) 1999-2015 Hiroyuki Yamamoto and the Claws Mail Team + * Copyright (C) 2014-2015 Ricardo Mones * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ GHashTable *missing_load_from_file(const gchar *filename) time_t t; long long unsigned seen; gchar md5sum[33]; - GHashTable *table; + GHashTable *table = NULL; int r = 0, a = 0, d = 0; if (file == NULL) { @@ -50,7 +50,7 @@ GHashTable *missing_load_from_file(const gchar *filename) t = time(NULL); if (t == (time_t)-1) { g_warning("Cannot get time!\n"); - return NULL; + goto close_exit; } table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); @@ -70,6 +70,7 @@ GHashTable *missing_load_from_file(const gchar *filename) a++; } +close_exit: if (fclose(file) != 0) g_warning("Error closing %s\n", filename);