From: Andre Noll Date: Fri, 11 Aug 2017 12:05:09 +0000 (+0200) Subject: Merge branch 'maint' X-Git-Tag: v0.6.1~31 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;h=8eb77a20423c3dcc44c4584a082e981391272cb2;hp=70a630c4c422298d40453c537edf9d326b613abc;p=paraslash.git Merge branch 'maint' * maint: server: Perform hostname lookup in client process. server: Fix memory leak in com_check(). --- diff --git a/mood.c b/mood.c index 315ef0cb..027a77d4 100644 --- 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); } diff --git a/server.c b/server.c index 4bc85a34..2bfc1d8f 100644 --- 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);