[torqueusers] Is this a bug?
Prakash Velayutham
velayups at email.uc.edu
Mon Aug 29 12:08:33 MDT 2005
Hi,
Should the pbsndlist and pbsndmast arrays (of ptr) have the same size?
I see in one place where there is a realloc of pbsndmast to svr_totnodes
+ 1. After this svr_totnodes++ is done. And a realloc of pbsndlist to
svr_totnodes + 1 (with already increased svr_totnodes variable). Is this
how it is supposed to be? All of these inside the "create_pbs_node"
function in the src/server/node_func.c file.
Here is the code snippet: (Note the underlined expressions)
.
tmpndlist = (struct pbsnode **)realloc(
pbsndmast,
sizeof(struct pbsnode*) * (_svr_totnodes + 1_));
if (tmpndlist == (struct pbsnode **)0)
{
free(pnode);
free(pul);
free(pname);
return(PBSE_SYSTEM);
}
/*add in the new entry etc*/
pbsndmast = tmpndlist;
pbsndmast[_svr_totnodes++_] = pnode;
tmpndlist = (struct pbsnode **)realloc(
pbsndlist,
sizeof(struct pbsnode *) * (_svr_totnodes + 1_));
.
Thanks,
Prakash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/torqueusers/attachments/20050829/84582da7/attachment.html
More information about the torqueusers
mailing list