Merge remote-tracking branch 'github/pr/1403'
authorFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 07:40:41 +0000 (08:40 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 07:40:41 +0000 (08:40 +0100)
src/libcollectdclient/network.c
src/snmp.c

index 0539cd0..7b98497 100644 (file)
@@ -89,6 +89,7 @@ static int server_close_socket (lcc_server_t *srv) /* {{{ */
     return (0);
 
   close (srv->fd);
+  srv->fd = -1;
   free (srv->sa);
   srv->sa = NULL;
   srv->sa_len = 0;
@@ -107,12 +108,6 @@ static void int_server_destroy (lcc_server_t *srv) /* {{{ */
 
   next = srv->next;
 
-  if (srv->fd >= 0)
-  {
-    close (srv->fd);
-    srv->fd = -1;
-  }
-
   free (srv->node);
   free (srv->service);
   free (srv->username);
index 0717365..8df7edd 100644 (file)
@@ -1398,7 +1398,7 @@ static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat
 static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
 {
   struct snmp_pdu *req;
-  struct snmp_pdu *res;
+  struct snmp_pdu *res = NULL;
   struct variable_list *vb;
 
   const data_set_t *ds;