Browse Source

BSocket: fix wrong error path in BSocket_Init

ambrop7 15 years ago
parent
commit
e1965b05c3
1 changed files with 3 additions and 2 deletions
  1. 3 2
      system/BSocket.c

+ 3 - 2
system/BSocket.c

@@ -621,15 +621,16 @@ int BSocket_Init (BSocket *bs, BReactor *bsys, int domain, int type)
     // initialize event backend
     // initialize event backend
     if (!init_event_backend(bs)) {
     if (!init_event_backend(bs)) {
         DEBUG("WARNING: init_event_backend failed");
         DEBUG("WARNING: init_event_backend failed");
-        goto fail1;
+        goto fail2;
     }
     }
     
     
     DebugObject_Init(&bs->d_obj);
     DebugObject_Init(&bs->d_obj);
     
     
     return 0;
     return 0;
     
     
-fail1:
+fail2:
     BPending_Free(&bs->job);
     BPending_Free(&bs->job);
+fail1:
     close_socket(fd);
     close_socket(fd);
 fail0:
 fail0:
     return -1;
     return -1;