From: Andre Noll Date: Sun, 22 Jan 2012 21:45:21 +0000 (+0100) Subject: para_client: Fix a memory leak. X-Git-Tag: v0.4.10~15 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=2fa3262b24c1e64191d8acfc3c4a96f2ef13c433 para_client: Fix a memory leak. The main function of para_client first calls client_parse_config() to decide whether to start an interactive session, run in completion mode or execute the given command. In the third case case we call client_open() which calls client_parse_config() again, thereby leaking the client_task structure which was returned by the first call to client_parse_config(). Fix this leak by calling client_connect() instead of client_open(). --- diff --git a/client.c b/client.c index 2242d40e..0ae01513 100644 --- a/client.c +++ b/client.c @@ -601,7 +601,7 @@ int main(int argc, char *argv[]) */ sit.btrn = btr_new_node(&(struct btr_node_description) EMBRACE(.name = "stdin")); - ret = client_open(argc, argv, &ct, &client_loglevel, sit.btrn, NULL, &sched); + ret = client_connect(ct, &sched, sit.btrn, NULL); if (ret < 0) goto out; sot.btrn = btr_new_node(&(struct btr_node_description)