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()
This commit is contained in:
Lucas De Marchi 2011-02-02 16:53:32 -02:00 committed by Denis Kenzior
parent 8387e79257
commit 16e3c0ffe4
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}