From 4e5782eb001abfa9d124450234759f60a124b99e Mon Sep 17 00:00:00 2001 From: Luiz Augusto Von Dentz Date: Fri, 18 Jun 2010 16:06:57 +0300 Subject: [PATCH] obexd: Fix crash on pbap client when message was already replied/freed --- obexd/client/pbap.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c index 8e4e025d6..709b8ecbb 100644 --- a/obexd/client/pbap.c +++ b/obexd/client/pbap.c @@ -337,6 +337,9 @@ static void pull_phonebook_callback(struct session_data *session, DBusMessage *reply; char *buf = ""; + if (session->msg == NULL) + return; + reply = dbus_message_new_method_return(session->msg); if (transfer->filled > 0) @@ -360,6 +363,9 @@ static void phonebook_size_callback(struct session_data *session, guint16 phone_book_size; guint8 new_missed_calls; + if (session->msg == NULL) + return; + reply = dbus_message_new_method_return(session->msg); read_return_apparam(session, &phone_book_size, &new_missed_calls); @@ -383,6 +389,9 @@ static void pull_vcard_listing_callback(struct session_data *session, DBusMessageIter iter, array; int i; + if (session->msg == NULL) + return; + reply = dbus_message_new_method_return(session->msg); if (transfer->filled == 0) @@ -710,7 +719,8 @@ static DBusMessage *pbap_pull_vcard(DBusConnection *connection, if (!pbapdata->path) return g_dbus_create_error(message, - ERROR_INF ".Forbidden", "Call Select first of all"); + ERROR_INF ".Forbidden", + "Call Select first of all"); if (dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &name, -- 2.47.3