I facing a problem due to Segmentation Fault on a void pointer using in the code.

HTML Code:
[CODE] struct Heap {
        void **ap;


In a Function I initializing this pointer ap as :
      if( ( hp->ap = (void**)malloc( c * sizeof( void * ) ) ) == NULL )
	return -1;[/CODE]
In this specific line I getting the Segmentation fault. I think this is due to the void pointer.

But , Please say me what is possible solution ?