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

Add new function free_slurm_conf for better memory clean-up.

parent 54e12fc2
No related branches found
No related tags found
No related merge requests found
...@@ -87,6 +87,35 @@ getnodename (char *name, size_t len) ...@@ -87,6 +87,35 @@ getnodename (char *name, size_t len)
return 0; return 0;
} }
/*
* free_slurm_conf - free all storage associated with a slurm_ctl_conf_t.
* IN/OUT ctl_conf_ptr - pointer to data structure to be freed
*/
void
free_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
{
xfree (ctl_conf_ptr->authtype);
xfree (ctl_conf_ptr->backup_addr);
xfree (ctl_conf_ptr->backup_controller);
xfree (ctl_conf_ptr->control_addr);
xfree (ctl_conf_ptr->control_machine);
xfree (ctl_conf_ptr->epilog);
xfree (ctl_conf_ptr->job_credential_private_key);
xfree (ctl_conf_ptr->job_credential_public_certificate);
xfree (ctl_conf_ptr->plugindir);
xfree (ctl_conf_ptr->prioritize);
xfree (ctl_conf_ptr->prolog);
xfree (ctl_conf_ptr->slurm_conf);
xfree (ctl_conf_ptr->slurm_user_name);
xfree (ctl_conf_ptr->slurmctld_logfile);
xfree (ctl_conf_ptr->slurmctld_pidfile);
xfree (ctl_conf_ptr->slurmd_logfile);
xfree (ctl_conf_ptr->slurmd_pidfile);
xfree (ctl_conf_ptr->slurmd_spooldir);
xfree (ctl_conf_ptr->state_save_location);
xfree (ctl_conf_ptr->tmp_fs);
}
/* /*
...@@ -132,8 +161,6 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr) ...@@ -132,8 +161,6 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
xfree (ctl_conf_ptr->slurmd_spooldir); xfree (ctl_conf_ptr->slurmd_spooldir);
ctl_conf_ptr->slurmd_timeout = (uint16_t) NO_VAL; ctl_conf_ptr->slurmd_timeout = (uint16_t) NO_VAL;
xfree (ctl_conf_ptr->state_save_location); xfree (ctl_conf_ptr->state_save_location);
xfree (ctl_conf_ptr->plugindir);
xfree (ctl_conf_ptr->authtype );
xfree (ctl_conf_ptr->tmp_fs); xfree (ctl_conf_ptr->tmp_fs);
ctl_conf_ptr->wait_time = (uint16_t) NO_VAL; ctl_conf_ptr->wait_time = (uint16_t) NO_VAL;
return; return;
......
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
*/ */
extern void init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr); extern void init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr);
/*
* free_slurm_conf - free all storage associated with a slurm_ctl_conf_t.
* IN/OUT ctl_conf_ptr - pointer to data structure to be freed
*/
extern void free_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr);
/* /*
* getnodename - equivalent to gethostname(), but return only the first * getnodename - equivalent to gethostname(), but return only the first
* component of the fully qualified name (e.g. "linux123.foo.bar" * component of the fully qualified name (e.g. "linux123.foo.bar"
......
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