Selaa lähdekoodia

fix cosmetic problems find by clang analyzer

ambrop7 13 vuotta sitten
vanhempi
sitoutus
d7c427733b
4 muutettua tiedostoa jossa 3 lisäystä ja 6 poistoa
  1. 0 1
      ncd/modules/net_iptables.c
  2. 0 2
      ncd/modules/sys_request_server.c
  3. 3 1
      server/server.c
  4. 0 2
      system/BProcess.c

+ 0 - 1
ncd/modules/net_iptables.c

@@ -561,7 +561,6 @@ fail0:
 static void unlock_func_die (void *vo)
 {
     struct unlock_instance *o = vo;
-    NCDModuleInst *i = o->i;
     
     // if lock is gone, die right away
     if (!o->lock) {

+ 0 - 2
ncd/modules/sys_request_server.c

@@ -791,7 +791,6 @@ static void instance_free (struct instance *o)
 static void func_die (void *vo)
 {
     struct instance *o = vo;
-    NCDModuleInst *i = o->i;
     ASSERT(!o->dying)
     
     // free listener
@@ -867,7 +866,6 @@ static void finish_func_new (NCDModuleInst *i)
     NCDModuleInst_Backend_Up(i);
     
     struct request *r = i->method_user;
-    struct connection *c = r->con;
     
     if (r->terminating) {
         ModuleLog(i, BLOG_ERROR, "request is dying, cannot submit finished");

+ 3 - 1
server/server.c

@@ -1369,7 +1369,9 @@ int client_send_newclient (struct client_data *client, struct client_data *nc, i
     }
     pack->id = htol16(nc->id);
     pack->flags = htol16(flags);
-    memcpy(pack + 1, cert_data, cert_len);
+    if (cert_len > 0) {
+        memcpy(pack + 1, cert_data, cert_len);
+    }
     client_end_control_packet(client, SCID_NEWCLIENT);
     
     return 0;

+ 0 - 2
system/BProcess.c

@@ -252,8 +252,6 @@ int BProcess_Init2 (BProcess *o, BProcessManager *m, BProcess_handler handler, v
             close(i);
         }
         
-        const int *orig_fds_map = params.fds_map;
-        
         // map fds to requested fd numbers
         while (*fds2 >= 0) {
             // resolve possible conflict