Allocating a 6-byte memory location with malloc() is rather silly
when this can be allocated on the stack.
---
 src/flash/nand.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/flash/nand.c b/src/flash/nand.c
index 51755aa..2b3b517 100644
--- a/src/flash/nand.c
+++ b/src/flash/nand.c
@@ -317,9 +317,7 @@ int nand_build_bbt(struct nand_device_s *device, int first, 
int last)
 {
        u32 page = 0x0;
        int i;
-       u8 *oob;
-       
-       oob = malloc(6);
+       u8 oob[6];
        
        if ((first < 0) || (first >= device->num_blocks))
                first = 0;
-- 
1.6.2.1.484.gaff6a

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to