X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=blobdiff_plain;f=second%2Fpartition.c;h=05823092614e1b9011fe4e2d88d26f69ebe32e40;hp=a95a1b25a6aa25844ee6215ee0868151a5c3b703;hb=c864c0961c4405bda1179fa4dc438fad3005e119;hpb=4d075ad792d6f99502a863a71d820658915dfcc1 diff --git a/second/partition.c b/second/partition.c index a95a1b2..0582309 100644 --- a/second/partition.c +++ b/second/partition.c @@ -280,6 +280,10 @@ partition_amiga_lookup( const char *dev_name, prom_handle disk, possible = amiga_block[AMIGA_RDBLIMIT]/32 +1; used = (unsigned int *) malloc (sizeof (unsigned int) * (possible + 1)); + if (!used) { + prom_printf("Can't allocate memory\n"); + return; + } for (i=0; i < possible; i++) used[i] = 0; @@ -322,6 +326,8 @@ partition_amiga_lookup( const char *dev_name, prom_handle disk, prom_blksize, 0 ); } + if (used) + free(used); } struct partition_t*