Diff between 1176dba49d26b7aa8a7b489e27c7924482a61dbe and 7f1fec29d50dce3d26928b7b0c4514b59ca15601

Changed Files

File Additions Deletions Status
obexd/src/obex.c +3 -8 modified

Full Patch

diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index ca8a7bb..8d85aa3 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -518,14 +518,9 @@ static gint obex_read_stream(struct obex_session *os, obex_t *obex,
 	}
 
 	if (os->object == NULL && size > 0) {
-		if (os->buf) {
-			error("Got more data but there is still a pending buffer");
-			return -EIO;
-		}
-
-		os->buf = g_malloc0(os->rx_mtu);
-		memcpy(os->buf, buffer, size);
-		os->offset = size;
+		os->buf = g_realloc(os->buf, os->offset + size);
+		memcpy(os->buf + os->offset, buffer, size);
+		os->offset += size;
 
 		debug("Stored %u bytes into temporary buffer", size);