From 0c43c53ca2aa3431c06ff8d865e6faeab3d63aa6 Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 22 Aug 2012 02:28:23 +0200 Subject: [PATCH] fixed some more coding fails --- src/ClientSocket.c | 2 ++ src/timeq.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ClientSocket.c b/src/ClientSocket.c index 13f8b6b..cb40cc7 100644 --- a/src/ClientSocket.c +++ b/src/ClientSocket.c @@ -61,6 +61,8 @@ void init_sockets() { } struct ClientSocket* create_socket(char *host, int port, char *bindto, char *pass, char *nick, char *ident, char *realname) { + if(!sockets) + init_sockets(); struct ClientSocket *client = malloc(sizeof(*client)); if (!client) { return NULL; diff --git a/src/timeq.c b/src/timeq.c index b53b58d..3350325 100644 --- a/src/timeq.c +++ b/src/timeq.c @@ -64,7 +64,8 @@ struct timeq_entry* timeq_uadd(int useconds, int module_id, timeq_callback_t *ca entry->name = NULL; entry->next = timeq_events; entry->prev = NULL; - timeq_events->prev = entry; + if(timeq_events) + timeq_events->prev = entry; timeq_events = entry; DESYNCHRONIZE(synchronized); return entry; -- 2.20.1