Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
828e4d2d
Commit
828e4d2d
authored
9 years ago
by
Brian Christiansen
Browse files
Options
Downloads
Patches
Plain Diff
Ensure that xhash_free sets the hash table pointer to NULL.
parent
c77aa354
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/xhash.c
+4
-4
4 additions, 4 deletions
src/common/xhash.c
src/common/xhash.h
+3
-1
3 additions, 1 deletion
src/common/xhash.h
src/slurmctld/read_config.c
+1
-2
1 addition, 2 deletions
src/slurmctld/read_config.c
with
8 additions
and
7 deletions
src/common/xhash.c
+
4
−
4
View file @
828e4d2d
...
...
@@ -184,12 +184,12 @@ void xhash_clear(xhash_t* table)
table
->
count
=
0
;
}
void
xhash_free
(
xhash_t
*
table
)
void
xhash_free
_ptr
(
xhash_t
*
*
table
)
{
if
(
!
table
)
if
(
!
table
||
!*
table
)
return
;
xhash_clear
(
table
);
xfree
(
table
);
xhash_clear
(
*
table
);
xfree
(
*
table
);
}
/* String hash table using the pjw hashing algorithm
...
...
This diff is collapsed.
Click to expand it.
src/common/xhash.h
+
3
−
1
View file @
828e4d2d
...
...
@@ -40,6 +40,8 @@
#include
<stdint.h>
#include
<pthread.h>
#define xhash_free(__p) xhash_free_ptr(&(__p));
/** Opaque definition of the hash table */
typedef
struct
xhash_st
xhash_t
;
...
...
@@ -126,7 +128,7 @@ void xhash_clear(xhash_t* table);
* @parameter table is the hash table to free. The table pointer is invalid
* after this call.
*/
void
xhash_free
(
xhash_t
*
table
);
void
xhash_free
_ptr
(
xhash_t
*
*
table
);
/* String hash table using the pjw hashing algorithm
* and chaining conflict resolution.
...
...
This diff is collapsed.
Click to expand it.
src/slurmctld/read_config.c
+
1
−
2
View file @
828e4d2d
...
...
@@ -901,8 +901,7 @@ int read_slurm_conf(int recover, bool reconfig)
}
node_record_table_ptr
=
NULL
;
node_record_count
=
0
;
xhash_free
(
node_hash_table
);
node_hash_table
=
NULL
;
xhash_free
(
node_hash_table
);
old_part_list
=
part_list
;
part_list
=
NULL
;
old_def_part_name
=
default_part_name
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment