projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da07e78
)
Check for valid scheduler before trying to free it.
author
Pekka Riikonen
<priikone@silcnet.org>
Mon, 2 Jul 2007 13:31:56 +0000
(13:31 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Mon, 2 Jul 2007 13:31:56 +0000
(13:31 +0000)
lib/silcclient/client.c
patch
|
blob
|
history
diff --git
a/lib/silcclient/client.c
b/lib/silcclient/client.c
index d7942f5f0525d9a336f2933081ab7ba7e36bf560..7811bfa131963d5947f7e73c006f771cede605db 100644
(file)
--- a/
lib/silcclient/client.c
+++ b/
lib/silcclient/client.c
@@
-947,7
+947,8
@@
SilcClient silc_client_alloc(SilcClientOperations *ops,
void silc_client_free(SilcClient client)
{
void silc_client_free(SilcClient client)
{
- silc_schedule_uninit(client->schedule);
+ if (client->schedule)
+ silc_schedule_uninit(client->schedule);
if (client->rng)
silc_rng_free(client->rng);
if (client->rng)
silc_rng_free(client->rng);
@@
-959,10
+960,13
@@
void silc_client_free(SilcClient client)
silc_hmac_unregister_all();
}
silc_hmac_unregister_all();
}
- silc_packet_engine_stop(client->internal->packet_engine);
- silc_dlist_uninit(client->internal->ftp_sessions);
+ if (client->internal->packet_engine)
+ silc_packet_engine_stop(client->internal->packet_engine);
+ if (client->internal->ftp_sessions)
+ silc_dlist_uninit(client->internal->ftp_sessions);
+ if (client->internal->lock)
+ silc_mutex_free(client->internal->lock);
silc_atomic_uninit16(&client->internal->conns);
silc_atomic_uninit16(&client->internal->conns);
- silc_mutex_free(client->internal->lock);
silc_free(client->username);
silc_free(client->hostname);
silc_free(client->realname);
silc_free(client->username);
silc_free(client->hostname);
silc_free(client->realname);