Skip to content
Snippets Groups Projects
Commit a34a78b9 authored by Moe Jette's avatar Moe Jette
Browse files

Replace if(X) bit_free(X) with macro FREE_NULL_BITMAP.

parent c6faa045
No related branches found
No related tags found
No related merge requests found
...@@ -103,15 +103,13 @@ static int _build_part_bitmap(struct part_record *part_record_point) ...@@ -103,15 +103,13 @@ static int _build_part_bitmap(struct part_record *part_record_point)
} }
if (part_record_point->nodes == NULL) { /* no nodes in partition */ if (part_record_point->nodes == NULL) { /* no nodes in partition */
if (old_bitmap) /* leave with empty bitmap */ FREE_NULL_BITMAP(old_bitmap);
bit_free(old_bitmap);
return 0; return 0;
} }
if ((host_list = if ((host_list =
hostlist_create(part_record_point->nodes)) == NULL) { hostlist_create(part_record_point->nodes)) == NULL) {
if (old_bitmap) FREE_NULL_BITMAP(old_bitmap);
bit_free(old_bitmap);
error("hostlist_create error on %s, %m", error("hostlist_create error on %s, %m",
part_record_point->nodes); part_record_point->nodes);
return ESLURM_INVALID_NODE_NAME; return ESLURM_INVALID_NODE_NAME;
...@@ -124,8 +122,7 @@ static int _build_part_bitmap(struct part_record *part_record_point) ...@@ -124,8 +122,7 @@ static int _build_part_bitmap(struct part_record *part_record_point)
("_build_part_bitmap: invalid node specified %s", ("_build_part_bitmap: invalid node specified %s",
this_node_name); this_node_name);
free(this_node_name); free(this_node_name);
if (old_bitmap) FREE_NULL_BITMAP(old_bitmap);
bit_free(old_bitmap);
hostlist_destroy(host_list); hostlist_destroy(host_list);
return ESLURM_INVALID_NODE_NAME; return ESLURM_INVALID_NODE_NAME;
} }
......
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