diff libpurple/ft.c @ 27799:da33da2e1a1e

Fix a bunch of memory leaks reported by Josh Mueller. Refs #9822.
author Paul Aurich <paul@darkrain42.org>
date Sun, 02 Aug 2009 05:04:41 +0000
parents 36d5e7690ad6
children 4a4e9d309fc0 0af4b1fb0566
line wrap: on
line diff
--- a/libpurple/ft.c	Sun Aug 02 04:33:26 2009 +0000
+++ b/libpurple/ft.c	Sun Aug 02 05:04:41 2009 +0000
@@ -953,15 +953,15 @@
 			if (wc != r) {
 				purple_debug_error("filetransfer", "Unable to write whole buffer.\n");
 				purple_xfer_cancel_local(xfer);
+				g_free(buffer);
 				return;
 			}
 		} else if(r < 0) {
 			purple_xfer_cancel_remote(xfer);
+			g_free(buffer);
 			return;
 		}
-	}
-
-	if (condition & PURPLE_INPUT_WRITE) {
+	} else if (condition & PURPLE_INPUT_WRITE) {
 		size_t result;
 		size_t s = MIN(purple_xfer_get_bytes_remaining(xfer), xfer->current_buffer_size);