]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'maint'
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 11 Aug 2017 12:05:09 +0000 (14:05 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 11 Aug 2017 12:05:09 +0000 (14:05 +0200)
* maint:
  server: Perform hostname lookup in client process.
  server: Fix memory leak in com_check().

mood.c
server.c

diff --git a/mood.c b/mood.c
index 315ef0cbdc61b7de1a3bbbd8f8683d7ab81d9c81..027a77d4db05bd33698f082ab8c11b03c26b1a06 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -363,9 +363,7 @@ success:
        ret = 1;
 out:
        free_argv(argv);
-       if (ret >= 0)
-               return ret;
-       if (mi) {
+       if (mi && (ret < 0 || !mlpd->m)) { /* mi was not added to any list */
                free(mi->parser_data);
                free(mi);
        }
index 4bc85a345b6328041059da62443a0d544371e324..2bfc1d8fc3f92ff003266de0c77e5ecf3f578a95 100644 (file)
--- a/server.c
+++ b/server.c
@@ -357,8 +357,6 @@ static int command_post_select(struct sched *s, void *context)
        ret = para_accept(sct->listen_fd, &s->rfds, NULL, 0, &new_fd);
        if (ret <= 0)
                goto out;
-       peer_name = remote_name(new_fd);
-       PARA_INFO_LOG("got connection from %s, forking\n", peer_name);
        mmd->num_connects++;
        mmd->active_connections++;
        /*
@@ -384,6 +382,8 @@ static int command_post_select(struct sched *s, void *context)
                /* parent keeps accepting connections */
                return 0;
        }
+       peer_name = remote_name(new_fd);
+       PARA_INFO_LOG("accepted connection from %s\n", peer_name);
        /* mmd might already have changed at this point */
        free(chunk_table);
        alarm(ALARM_TIMEOUT);