Fix a (tiny) memory leak in mod-sockcheck.c.
authorMichael Poole <mdpoole@troilus.org>
Sat, 7 Oct 2006 00:03:52 +0000 (00:03 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 7 Oct 2006 00:03:52 +0000 (00:03 +0000)
src/mod-sockcheck.c (sockcheck_begin_test): Make io_fd assignment
    clearer.
  (sockcheck_read_conf): Free the addrinfo we get.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-58

ChangeLog
src/mod-sockcheck.c

index 8131210cd80f1307c68444314e033362e06ace1f..8f8191b992097924c75b8bb036ee66c8e0d648ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
 #
 
+2006-10-07 00:03:52 GMT        Michael Poole <mdpoole@troilus.org>     patch-58
+
+    Summary:
+      Fix a (tiny) memory leak in mod-sockcheck.c.
+    Revision:
+      srvx--devo--1.3--patch-58
+
+    src/mod-sockcheck.c (sockcheck_begin_test): Make io_fd assignment
+        clearer.
+      (sockcheck_read_conf): Free the addrinfo we get.
+
+    modified files:
+     ChangeLog src/mod-sockcheck.c
+
+
 2006-10-06 23:18:58 GMT        Michael Poole <mdpoole@troilus.org>     patch-57
 
     Summary:
index a21aad9122e102276164f120f62723f7bb7ba3d0..8413e9034a64172b402fedd13efba8cdaa1671e2 100644 (file)
@@ -662,7 +662,8 @@ sockcheck_begin_test(struct sockcheck_client *client)
         client->state = client->tests->list[client->test_index];
         client->read_pos = 0;
         client->read_used = 0;
-        client->fd = io_fd = ioset_connect(sockcheck_conf.local_addr, sockcheck_conf.local_addr_len, client->addr->hostname, client->state->port, 0, client, sockcheck_connected);
+        io_fd = ioset_connect(sockcheck_conf.local_addr, sockcheck_conf.local_addr_len, client->addr->hostname, client->state->port, 0, client, sockcheck_connected);
+        client->fd = io_fd;
         if (!io_fd) {
             client->test_index++;
             continue;
@@ -1151,6 +1152,7 @@ sockcheck_read_conf(void)
            sockcheck_conf.local_addr_len = ai->ai_addrlen;
             sockcheck_conf.local_addr = calloc(1, ai->ai_addrlen);
             memcpy(sockcheck_conf.local_addr, ai->ai_addr, ai->ai_addrlen);
+            freeaddrinfo(ai);
         } else {
             sockcheck_conf.local_addr_len = 0;
             sockcheck_conf.local_addr = NULL;