pidgin: f0ebf0c8: Handle dest failing to open properly by ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sun Jun 28 17:55:36 EDT 2009


-----------------------------------------------------------------
Revision: f0ebf0c8707a58324b0ca73bf9dc479e09b657b6
Ancestor: a6dc4f4b52aaf81e56bd694395a4f45f4472a0dc
Author: darkrain42 at pidgin.im
Date: 2009-06-28T21:50:14
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f0ebf0c8707a58324b0ca73bf9dc479e09b657b6

Modified files:
        pidgin/gtkprefs.c

ChangeLog: 

Handle dest failing to open properly by closing the src handle.

Thanks to Adam Petaccia for pointing this out.

-------------- next part --------------
============================================================
--- pidgin/gtkprefs.c	db52276689b0630d664f160b85d60b47642378d0
+++ pidgin/gtkprefs.c	a89efba6c018f02624040cff182bd737de049a61
@@ -650,8 +650,10 @@ purple_theme_file_copy(const gchar *sour
 
     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);


More information about the Commits mailing list