Skip to content
Snippets Groups Projects
Commit 990eb2e0 authored by Morris Jette's avatar Morris Jette Committed by Danny Auble
Browse files

Make it so if xmalloc returns NULL we still get a size in the perl api.

This changed in 17.11 where if the size was 0 we would return 0 which messes
up the perl api.

Bug 3644
parent cc8edc07
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ documents those changes that are of interest to users and administrators.
-- When running the "scontrol top" command, make sure that all of the user's
jobs have a priority that is lower than the selected job. Previous logic
would permit other jobs with equal priority (no jobs with higher priority).
-- Fix perl api so we always get an allocation when calling Slurm::new().
* Changes in Slurm 17.02.2
==========================
......
......@@ -30,7 +30,12 @@ static struct slurm default_slurm_object;
static slurm_t
new_slurm(void)
{
return xmalloc(sizeof(struct slurm));
int size = sizeof(struct slurm);
if (size == 0) {
/* Avoid returning NULL, which causes the perl APIs to fail */
size = 1;
}
return xmalloc(size);
}
static void
......
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