Currently, I create a processElement which has resource array & request
array. These 2 arrays will be expanded in the later stage for storage.
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?)
resource = (resource_type**)realloc(resource,
after realloc, I check the resource has the number I want, but
I can't access resoruce, 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?