From: pk910 Date: Wed, 22 Aug 2012 00:28:23 +0000 (+0200) Subject: fixed some more coding fails X-Git-Tag: v5.5~9^2~11 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=0c43c53ca2aa3431c06ff8d865e6faeab3d63aa6 fixed some more coding fails --- 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;