Ticket 198 - Removed malloc error logic in several files
Summary: Removed malloc error logic in several files
Status: RESOLVED FIXED
Alias: None
Product: Slurm
Classification: Unclassified
Component: Other (show other tickets)
Version: 2.4.x
Hardware: Linux Linux
: 5 - Enhancement
Assignee: Moe Jette
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2013-01-07 10:52 MST by Nathan Yee
Modified: 2013-01-08 05:01 MST (History)
1 user (show)

See Also:
Site: SchedMD
Slinky Site: ---
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
Google sites: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed:
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments
Removed all the malloc error logic in multiple files (87.13 KB, patch)
2013-01-07 10:52 MST, Nathan Yee
Details | Diff

Note You need to log in before you can comment on or make changes to this ticket.
Description Nathan Yee 2013-01-07 10:52:46 MST
Created attachment 170 [details]
Removed all the malloc error logic in multiple files
Comment 1 Moe Jette 2013-01-08 05:01:39 MST
I found four problems, all similar. Here's a C lesson for you:

	if (!(job_resrcs_ptr->node_bitmap = bit_copy(bitmap)))
		fatal("bit_copy malloc failure");

Is equivalent to:

	job_resrcs_ptr->node_bitmap = bit_copy(bitmap);
	if (!job_resrcs_ptr->node_bitmap)
		fatal("bit_copy malloc failure");

It is just compressed to save some space and perhaps make the logic more clear. So rather than remove the 2 lines in the first example complete, it needed to be change to:

	job_resrcs_ptr->node_bitmap = bit_copy(bitmap);