Currently, I create a processElement which has resource array & request
array. These 2 arrays will be expanded in the later stage for storage.

i.e.
process = (process_type*) malloc( sizeof(process_type) );
resource = (resource_type**) malloc( resourceNum*sizeof(resource_type*) );
request = (request_type**) malloc( requestNum*sizeof(resource_type*) );
(Do I malloc correctly?)

then
resource = (resource_type**)realloc(resource,
growthSize*resourceNum*sizeof(resource_type*));

after realloc, I check the resource[0] has the number I want, but
I can't access resoruce[1], ect. It is seg fault. I am not sure
the behaviour of realloc. As I know, resource sits inside the
realloc may cause mem leak. Is it the cause?

regards
figo2476