From 16e3c0ffe42785e045bf4753a3ca1d7e1f52c01b Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 2 Feb 2011 16:53:32 -0200 Subject: [PATCH] smart-messaging: set agent to NULL after free If agent is not set to NULL after it's freed, the following situation would not work: smart_messaging_register_agent() smart_messaging_unregister_agent() smart_messaging_register_agent() And this one could potentially crash oFono: smart_messaging_register_agent() smart_messaging_unregister_agent() smart_messaging_unregister_agent() --- plugins/smart-messaging.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/smart-messaging.c b/plugins/smart-messaging.c index 40af89f9..52344de2 100644 --- a/plugins/smart-messaging.c +++ b/plugins/smart-messaging.c @@ -165,6 +165,7 @@ static DBusMessage *smart_messaging_unregister_agent(DBusConnection *conn, return __ofono_error_failed(msg); sms_agent_free(sm->agent); + sm->agent = NULL; return dbus_message_new_method_return(msg); }