[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2a2-35-g810dcf2
Service Account
noreply at mpich.org
Fri Dec 5 13:10:00 CST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 810dcf24c3f9c3c35106efe9af8e6fb6b73ce400 (commit)
from 32788e87819dda3e98968b977ddf12827009d372 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/810dcf24c3f9c3c35106efe9af8e6fb6b73ce400
commit 810dcf24c3f9c3c35106efe9af8e6fb6b73ce400
Author: andrey.lobanov <andrey.lobanov at intel.com>
Date: Fri Oct 17 13:58:21 2014 +0400
fixed memory leaks in pmi messages handling
- name publishing/lookup support (pmi v1 and v2)
- job and node attrs (v2)
Change-Id: Id18d968da0d0bbf6e8cb2e7acffaf77d82a5e8b0
Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>
diff --git a/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c b/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
index 66f677b..7a1723b 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
@@ -19,7 +19,7 @@ static HYD_status send_cmd_upstream(const char *start, int fd, char *args[])
{
int i, sent, closed;
struct HYD_string_stash stash;
- char *buf;
+ char *buf = NULL;
struct HYD_pmcd_hdr hdr;
HYD_status status = HYD_SUCCESS;
@@ -56,6 +56,8 @@ static HYD_status send_cmd_upstream(const char *start, int fd, char *args[])
HYDU_ASSERT(!closed, status);
fn_exit:
+ if (buf)
+ HYDU_FREE(buf);
HYDU_FUNC_EXIT();
return status;
@@ -216,7 +218,7 @@ static HYD_status fn_job_getid(int fd, char *args[])
{
struct HYD_string_stash stash;
char *cmd, *thrid;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -244,6 +246,8 @@ static HYD_status fn_job_getid(int fd, char *args[])
HYDU_FREE(cmd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
HYDU_FUNC_EXIT();
return status;
@@ -255,7 +259,7 @@ static HYD_status fn_info_putnodeattr(int fd, char *args[])
{
struct HYD_string_stash stash;
char *key, *val, *thrid, *cmd;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
int token_count, ret;
struct HYD_pmcd_pmi_v2_reqs *req;
HYD_status status = HYD_SUCCESS;
@@ -302,6 +306,8 @@ static HYD_status fn_info_putnodeattr(int fd, char *args[])
}
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
HYDU_FUNC_EXIT();
return status;
@@ -316,7 +322,7 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
char *key, *waitval, *thrid;
struct HYD_string_stash stash;
char *cmd;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -384,6 +390,8 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
}
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
HYDU_FUNC_EXIT();
return status;
@@ -446,7 +454,7 @@ static HYD_status fn_finalize(int fd, char *args[])
char *thrid;
struct HYD_string_stash stash;
char *cmd;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -476,6 +484,8 @@ static HYD_status fn_finalize(int fd, char *args[])
close(fd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
HYDU_FUNC_EXIT();
return status;
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
index b3c0dfe..a855582 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
@@ -629,8 +629,8 @@ static HYD_status fn_publish_name(int fd, int pid, int pgid, char *args[])
struct HYD_string_stash stash;
char *cmd, *val;
int token_count;
- struct HYD_pmcd_token *tokens;
- char *name, *port;
+ struct HYD_pmcd_token *tokens = NULL;
+ char *name = NULL, *port = NULL;
int success = 0;
HYD_status status = HYD_SUCCESS;
@@ -666,6 +666,13 @@ static HYD_status fn_publish_name(int fd, int pid, int pgid, char *args[])
HYDU_FREE(cmd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
+ if (name)
+ HYDU_FREE(name);
+ if (port)
+ HYDU_FREE(port);
+
HYDU_FUNC_EXIT();
return status;
@@ -678,7 +685,7 @@ static HYD_status fn_unpublish_name(int fd, int pid, int pgid, char *args[])
struct HYD_string_stash stash;
char *cmd, *name;
int token_count;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
int success = 0;
HYD_status status = HYD_SUCCESS;
@@ -709,6 +716,8 @@ static HYD_status fn_unpublish_name(int fd, int pid, int pgid, char *args[])
HYDU_FREE(cmd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
HYDU_FUNC_EXIT();
return status;
@@ -719,9 +728,9 @@ static HYD_status fn_unpublish_name(int fd, int pid, int pgid, char *args[])
static HYD_status fn_lookup_name(int fd, int pid, int pgid, char *args[])
{
struct HYD_string_stash stash;
- char *cmd, *name, *value;
+ char *cmd, *name, *value = NULL;
int token_count;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -753,6 +762,10 @@ static HYD_status fn_lookup_name(int fd, int pid, int pgid, char *args[])
HYDU_FREE(cmd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
+ if (value)
+ HYDU_FREE(value);
HYDU_FUNC_EXIT();
return status;
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
index b079b7d..00e6377 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
@@ -747,9 +747,9 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
static HYD_status fn_name_publish(int fd, int pid, int pgid, char *args[])
{
struct HYD_string_stash stash;
- char *cmd, *thrid, *val, *name, *port;
+ char *cmd, *thrid, *val, *name = NULL, *port = NULL;
int token_count, success;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -792,6 +792,12 @@ static HYD_status fn_name_publish(int fd, int pid, int pgid, char *args[])
HYDU_FREE(cmd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
+ if (name)
+ HYDU_FREE(name);
+ if (port)
+ HYDU_FREE(port);
HYDU_FUNC_EXIT();
return status;
@@ -804,7 +810,7 @@ static HYD_status fn_name_unpublish(int fd, int pid, int pgid, char *args[])
struct HYD_string_stash stash;
char *cmd, *thrid, *name;
int token_count, success;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -842,6 +848,8 @@ static HYD_status fn_name_unpublish(int fd, int pid, int pgid, char *args[])
HYDU_FREE(cmd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
HYDU_FUNC_EXIT();
return status;
@@ -853,9 +861,8 @@ static HYD_status fn_name_lookup(int fd, int pid, int pgid, char *args[])
{
struct HYD_string_stash stash;
char *cmd, *thrid, *name, *value;
- struct HYD_pmcd_pmi_publish *publish;
int token_count;
- struct HYD_pmcd_token *tokens;
+ struct HYD_pmcd_token *tokens = NULL;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -865,9 +872,6 @@ static HYD_status fn_name_lookup(int fd, int pid, int pgid, char *args[])
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
- HYDU_MALLOC(publish, struct HYD_pmcd_pmi_publish *, sizeof(struct HYD_pmcd_pmi_publish),
- status);
-
if ((name = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "name")) == NULL)
HYDU_ERR_POP(status, "cannot find token: name\n");
@@ -897,6 +901,8 @@ static HYD_status fn_name_lookup(int fd, int pid, int pgid, char *args[])
HYDU_FREE(cmd);
fn_exit:
+ if (tokens)
+ HYD_pmcd_pmi_free_tokens(tokens, token_count);
HYDU_FUNC_EXIT();
return status;
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c | 20 +++++++++++++++-----
src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c | 23 ++++++++++++++++++-----
src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c | 22 ++++++++++++++--------
3 files changed, 47 insertions(+), 18 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list