Diff between d9cff588be2dd17871a8c93577268373c7249fba and ac68d205e48a653ec5ca351e16d033164870eb38

Changed Files

File Additions Deletions Status
obexd/src/obex-priv.h +1 -1 modified
obexd/src/obex.c +5 -1 modified

Full Patch

diff --git a/obexd/src/obex-priv.h b/obexd/src/obex-priv.h
index 0f167ce..265ac8c 100644
--- a/obexd/src/obex-priv.h
+++ b/obexd/src/obex-priv.h
@@ -45,7 +45,7 @@ struct obex_session {
 	uint8_t cmd;
 	char *name;
 	char *type;
-	const char *path;
+	char *path;
 	time_t time;
 	uint8_t *buf;
 	int32_t pending;
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 38ff438..0f860d8 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -132,6 +132,10 @@ static void os_reset_session(struct obex_session *os)
 		g_free(os->buf);
 		os->buf = NULL;
 	}
+	if (os->path) {
+		g_free(os->path);
+		os->path = NULL;
+	}
 
 	os->driver = NULL;
 	os->aborted = FALSE;
@@ -693,7 +697,7 @@ int obex_put_stream_start(struct obex_session *os, const char *filename)
 		return -EPERM;
 	}
 
-	os->path = filename;
+	os->path = g_strdup(filename);
 
 	if (!os->buf) {
 		debug("PUT request checked, no buffered data");