Release notes are done.
[metze/wireshark/wip.git] / update.c
index 8aa636e1cc0504695116d42cc3d10fb1d2e9811e..13bb7adfbe325f51e03a37e40d4701e424edfaaf 100644 (file)
--- a/update.c
+++ b/update.c
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <string.h>
@@ -83,6 +81,7 @@ download_file(const char *url, const char *filename) {
     /* connect to url */
     conn = netio_ie5_connect (url);
     if (conn == NULL) {
+        ws_close(fd);
         g_warning("Couldn't connect to %s!", url);
         return -1;
     }
@@ -118,23 +117,14 @@ update_info_new(void)
 void
 update_info_delete(update_info_t *update_info)
 {
-    if(update_info->prefix)
-        g_free(update_info->prefix);
-    if(update_info->version_installed)
-        g_free(update_info->version_installed);
-
-    if(update_info->title)
-        g_free(update_info->title);
-    if(update_info->description)
-        g_free(update_info->description);
-    if(update_info->version_recommended)
-        g_free(update_info->version_recommended);
-    if(update_info->url)
-        g_free(update_info->url);
-    if(update_info->md5)
-        g_free(update_info->md5);
-    if(update_info->size)
-        g_free(update_info->size);
+    g_free(update_info->prefix);
+    g_free(update_info->version_installed);
+    g_free(update_info->title);
+    g_free(update_info->description);
+    g_free(update_info->version_recommended);
+    g_free(update_info->url);
+    g_free(update_info->md5);
+    g_free(update_info->size);
 
     g_free(update_info);
 }
@@ -293,8 +283,7 @@ update_check_winpcap(const char *local_file)
     }
 
     g_string_free(pcap_version_tmp, TRUE);
-    if(pcap_version)
-        g_free(pcap_version);
+    g_free(pcap_version);
 
     return update_info;
 }
@@ -312,7 +301,7 @@ update_check(gboolean interactive)
 
     /* build update file name */
     /* XXX - using the personal path, use temp dir instead? */
-    local_file = get_persconffile_path("wsupdate", FALSE, TRUE /*for_writing*/);
+    local_file = get_persconffile_path("wsupdate", FALSE);
     if(local_file == NULL) {
         g_warning("Couldn't create output path!");
         return;