target/riscv-011: Fix memory leak in handle_halt_routine() 84/4884/2
authorMarc Schink <openocd-dev@marcschink.de>
Wed, 6 Feb 2019 11:07:10 +0000 (12:07 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 14 Feb 2019 09:28:33 +0000 (09:28 +0000)
Tested with SiFive HiFive1 development board.

Change-Id: Ie0d9fa0899804d17ccdd84b03ba4028e97b632b8
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4884
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/riscv/riscv-011.c

index 3820d8fc0ff896479d243a77e987a711ddc0239f..bd3f159fbeebd213683cb8eefc68867f8f695579 100644 (file)
@@ -1806,6 +1806,8 @@ static riscv_error_t handle_halt_routine(struct target *target)
                }
        }
 
+       scans_delete(scans);
+
        if (dbus_busy) {
                increase_dbus_busy_delay(target);
                return RE_AGAIN;
@@ -1819,8 +1821,6 @@ static riscv_error_t handle_halt_routine(struct target *target)
        info->dpc = reg_cache_get(target, CSR_DPC);
        info->dcsr = reg_cache_get(target, CSR_DCSR);
 
-       scans_delete(scans);
-
        cache_invalidate(target);
 
        return RE_OK;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)