diff options
author | Spencer Oliver <ntfreak@users.sourceforge.net> | 2010-05-29 15:43:42 +0100 |
---|---|---|
committer | Spencer Oliver <ntfreak@users.sourceforge.net> | 2010-05-29 15:43:42 +0100 |
commit | 86e851e1e263c79f19eb9db52553de99f19b8bb9 (patch) | |
tree | f27ce597e5d63329677f4f5967beb0437350452d /src/flash/nor/stellaris.c | |
parent | 215353ef67434e41b13f8948dc7dceefc110e3fe (diff) |
nor: fix memory leaks during probe
Fix similar memory leaks as per commit:
ef72484b785ec7462a0415afea679d08b864c7fb
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Diffstat (limited to 'src/flash/nor/stellaris.c')
-rw-r--r-- | src/flash/nor/stellaris.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index 38374ffe..f7e2e8d9 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -1065,6 +1065,12 @@ static int stellaris_probe(struct flash_bank *bank) if (retval != ERROR_OK) return retval; + if (bank->sectors) + { + free(bank->sectors); + bank->sectors = NULL; + } + /* provide this for the benefit of the NOR flash framework */ bank->size = 1024 * stellaris_info->num_pages; bank->num_sectors = stellaris_info->num_pages; |