pidgin/gtkstatusbox.c

changeset 22192
caf56838b384
parent 22104
56970903b8e9
child 22229
8560c89895a9
--- a/pidgin/gtkstatusbox.c	Sun Jan 13 20:51:33 2008 +0000
+++ b/pidgin/gtkstatusbox.c	Sun Jan 13 21:04:47 2008 +0000
@@ -320,12 +320,20 @@
 {
 	FILE *f;
 	gchar *path;
+	size_t wc;
 
 	if ((error_message != NULL) || (len == 0))
 		return;
 
 	f = purple_mkstemp(&path, TRUE);
-	fwrite(themedata, len, 1, f);
+	wc = fwrite(themedata, len, 1, f);
+	if (wc != 1) {
+		purple_debug_warning("theme_got_url", "Unable to write theme data.\n");
+		fclose(f);
+		g_unlink(path);
+		g_free(path);
+		return;
+	}
 	fclose(f);
 
 	icon_choose_cb(path, user_data);

mercurial