Skip to content
Snippets Groups Projects
Commit 4ee9c786 authored by Morris Jette's avatar Morris Jette
Browse files

Fix memory leak in gres/mic and gres/gpu plugins

parent 9092b68d
No related branches found
No related tags found
No related merge requests found
...@@ -130,8 +130,6 @@ extern int node_config_load(List gres_conf_list) ...@@ -130,8 +130,6 @@ extern int node_config_load(List gres_conf_list)
iter = list_iterator_create(gres_conf_list); iter = list_iterator_create(gres_conf_list);
if (iter == NULL) if (iter == NULL)
fatal("list_iterator_create: malloc failure"); fatal("list_iterator_create: malloc failure");
iter = list_iterator_create(gres_conf_list);
while ((gres_slurmd_conf = list_next(iter))) { while ((gres_slurmd_conf = list_next(iter))) {
if (strcmp(gres_slurmd_conf->name, gres_name)) if (strcmp(gres_slurmd_conf->name, gres_name))
continue; continue;
...@@ -153,6 +151,8 @@ extern int node_config_load(List gres_conf_list) ...@@ -153,6 +151,8 @@ extern int node_config_load(List gres_conf_list)
} }
iter = list_iterator_create(gres_conf_list); iter = list_iterator_create(gres_conf_list);
if (iter == NULL)
fatal("list_iterator_create: malloc failure");
while ((gres_slurmd_conf = list_next(iter))) { while ((gres_slurmd_conf = list_next(iter))) {
if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) && if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
gres_slurmd_conf->file) { gres_slurmd_conf->file) {
......
...@@ -132,8 +132,6 @@ extern int node_config_load(List gres_conf_list) ...@@ -132,8 +132,6 @@ extern int node_config_load(List gres_conf_list)
iter = list_iterator_create(gres_conf_list); iter = list_iterator_create(gres_conf_list);
if (iter == NULL) if (iter == NULL)
fatal("list_iterator_create: malloc failure"); fatal("list_iterator_create: malloc failure");
iter = list_iterator_create(gres_conf_list);
while ((gres_slurmd_conf = list_next(iter))) { while ((gres_slurmd_conf = list_next(iter))) {
if (strcmp(gres_slurmd_conf->name, gres_name)) if (strcmp(gres_slurmd_conf->name, gres_name))
continue; continue;
...@@ -155,6 +153,8 @@ extern int node_config_load(List gres_conf_list) ...@@ -155,6 +153,8 @@ extern int node_config_load(List gres_conf_list)
} }
iter = list_iterator_create(gres_conf_list); iter = list_iterator_create(gres_conf_list);
if (iter == NULL)
fatal("list_iterator_create: malloc failure");
while ((gres_slurmd_conf = list_next(iter))) { while ((gres_slurmd_conf = list_next(iter))) {
if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) && if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
gres_slurmd_conf->file) { gres_slurmd_conf->file) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment