diff --git a/obexd/client/session.c b/obexd/client/session.c
index f903622..7e06ee3 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
struct callback_data *callback = user_data;
struct session_data *session = callback->session;
GwObex *obex;
- int fd, len;
+ int fd;
if (cond & (G_IO_NVAL | G_IO_ERR))
goto done;
fd = g_io_channel_unix_get_fd(io);
- len = (session->target ? 16 : 0);
- obex = gw_obex_setup_fd(fd, session->target, len, NULL, NULL);
+ obex = gw_obex_setup_fd(fd, session->target,
+ session->target_len, NULL, NULL);
callback->session->sock = fd;
callback->session->obex = obex;
if (target != NULL) {
session->uuid = OBEX_FILETRANS_SVCLASS_ID;
session->target = FOLDER_BROWSING_UUID;
+ session->target_len = 16;
} else
session->uuid = OBEX_OBJPUSH_SVCLASS_ID;
diff --git a/obexd/client/session.h b/obexd/client/session.h
index aea62a2..e78e533 100644
--- a/obexd/client/session.h
+++ b/obexd/client/session.h
bdaddr_t dst;
uint8_t channel;
const char *target; /* OBEX Target UUID */
+ int target_len;
uint16_t uuid; /* Bluetooth Service Class */
gchar *name;
gchar *path;