changeset 27209:03525f97c9d8

Handle dest failing to open properly by closing the src handle. Thanks to Adam Petaccia for pointing this out.
author Paul Aurich <paul@darkrain42.org>
date Sun, 28 Jun 2009 21:50:14 +0000
parents 9f2112ba6049
children cb720963732d
files pidgin/gtkprefs.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Sun Jun 28 19:14:03 2009 +0000
+++ b/pidgin/gtkprefs.c	Sun Jun 28 21:50:14 2009 +0000
@@ -650,8 +650,10 @@
 
     if(!(src = g_fopen(source, "rb")))
         return FALSE;
-    if(!(dest = g_fopen(destination, "wb")))
+    if(!(dest = g_fopen(destination, "wb"))) {
+		fclose(src);
         return FALSE;
+	}
 
     while((chr = fgetc(src)) != EOF) {
         fputc(chr, dest);