diff --git a/stable/ppc32.c b/stable/ppc32.c index 01c73cd26..03c338687 100644 --- a/stable/ppc32.c +++ b/stable/ppc32.c @@ -179,6 +179,10 @@ int ppc32_get_idling_pc(cpu_gen_t *cpu) printf("\nPlease wait while gathering statistics...\n"); pc_hash = calloc(IDLE_HASH_SIZE,sizeof(struct ppc32_idle_pc_hash *)); + if (pc_hash == NULL) { + printf("Out of memory."); + return(-1); + } /* Disable IRQ */ pcpu->irq_disable = TRUE; diff --git a/unstable/ppc32.c b/unstable/ppc32.c index 2edccb5db..8b0240b37 100644 --- a/unstable/ppc32.c +++ b/unstable/ppc32.c @@ -176,6 +176,10 @@ int ppc32_get_idling_pc(cpu_gen_t *cpu) printf("\nPlease wait while gathering statistics...\n"); pc_hash = calloc(IDLE_HASH_SIZE,sizeof(struct ppc32_idle_pc_hash *)); + if (pc_hash == NULL) { + printf("Out of memory."); + return(-1); + } /* Disable IRQ */ pcpu->irq_disable = TRUE;