This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 6008216  flash_test: fix resource leak on error (#2164)
6008216 is described below

commit 60082163abc289fc0fcebc8c84021429086ee3ab
Author: Vipul Rahane <vipulrah...@apache.org>
AuthorDate: Thu Jan 23 18:07:46 2020 -0800

    flash_test: fix resource leak on error (#2164)
---
 test/flash_test/src/flash_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/flash_test/src/flash_test.c b/test/flash_test/src/flash_test.c
index 4758e84..c18c5e6 100644
--- a/test/flash_test/src/flash_test.c
+++ b/test/flash_test/src/flash_test.c
@@ -224,6 +224,7 @@ flash_speed_test(int flash_dev, uint32_t addr, int sz, int 
move)
         if (rc) {
             console_printf("hal_flash_read(%d, 0x%x, %d) = %d\n",
               flash_dev, (unsigned int)addr + off, (unsigned int)sz, rc);
+            free(data_buf);
             return -1;
         }
         if (move) {

Reply via email to