[prev in list] [next in list] [prev in thread] [next in thread]
List: openocd-development
Subject: [OpenOCD-devel] [PATCH]: e3718b7 flash/nor/faux.c: fixing check for failed malloc
From: gerrit () openocd ! org (gerrit)
Date: 2016-02-26 22:40:17
Message-ID: 20160226224017.059641984338 () mail ! openocd ! org
[Download RAW message or body]
This is an automated email from Gerrit.
Anonymous Coward (akurz@blala.de) just uploaded a new patch set to Gerrit, which you \
can find at http://openocd.zylin.com/3364
-- gerrit
commit e3718b7d460a76885db74f726269e1b4996d957a
Author: Alexander Kurz <akurz@blala.de>
Date: Fri Feb 26 23:38:50 2016 +0100
flash/nor/faux.c: fixing check for failed malloc
Error found by static code analysis using the semantic pattern
null_ref2/mini_null_ref2.cocci, see coccinellery.org
Change-Id: Ic817c29f0ccf2b41fc8f7d9a480ad30d6e5b7ab8
Signed-off-by: Alexander Kurz <akurz@blala.de>
diff --git a/src/flash/nor/faux.c b/src/flash/nor/faux.c
index 1fd1da2..8198ef5 100644
--- a/src/flash/nor/faux.c
+++ b/src/flash/nor/faux.c
@@ -50,7 +50,7 @@ FLASH_BANK_COMMAND_HANDLER(faux_flash_bank_command)
return ERROR_FAIL;
}
info->memory = malloc(bank->size);
- if (info == NULL) {
+ if (info->memory == NULL) {
free(info);
LOG_ERROR("no memory for flash bank info");
return ERROR_FAIL;
--
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic