fixed some more coding fails
authorpk910 <philipp@zoelle1.de>
Wed, 22 Aug 2012 00:28:23 +0000 (02:28 +0200)
committerpk910 <philipp@zoelle1.de>
Wed, 22 Aug 2012 00:30:45 +0000 (02:30 +0200)
src/ClientSocket.c
src/timeq.c

index 13f8b6b6d55f82b9debe72288f0422f35694f197..cb40cc7dc9eb1afe311919d685ca16de153846e7 100644 (file)
@@ -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;
index b53b58ddd25689d91674d75537e6bcb25c289560..335032519f52a837b01c9f5e58bce5cc88face4e 100644 (file)
@@ -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;