settings: don't dereference NULL pointer on request removal

This commit is contained in:
Mikhail Efremov 2011-03-05 00:01:01 -06:00 committed by Dan Williams
parent ffb9457d55
commit 77eeb95233

View file

@ -448,6 +448,7 @@ request_free (Request *req)
if (req->idle_id) if (req->idle_id)
g_source_remove (req->idle_id); g_source_remove (req->idle_id);
if (req->cancel_callback)
req->cancel_callback (req); req->cancel_callback (req);
g_slist_free (req->pending); g_slist_free (req->pending);
@ -459,6 +460,7 @@ request_free (Request *req)
g_hash_table_unref (req->existing_secrets); g_hash_table_unref (req->existing_secrets);
if (req->chain) if (req->chain)
nm_auth_chain_unref (req->chain); nm_auth_chain_unref (req->chain);
if (req->authority)
g_object_unref (req->authority); g_object_unref (req->authority);
memset (req, 0, sizeof (Request)); memset (req, 0, sizeof (Request));
g_free (req); g_free (req);