]> git.ozlabs.org Git - yaboot.git/blobdiff - second/partition.c
git-archimport-id: pnasrat@redhat.com/yaboot--devel--1.3--patch-1
[yaboot.git] / second / partition.c
index a95a1b25a6aa25844ee6215ee0868151a5c3b703..05823092614e1b9011fe4e2d88d26f69ebe32e40 100644 (file)
@@ -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*