The noalloc flag was stripped out by instr_reset, and the heap-leak-based test was in api.drdecode, which doesn't actually check for leaks and so did not catch the bug. Here we fix the bug to preserve the flag, and place a test in api.ir which does do the leak check. Confirmed that the test fails without the fix.
Issue: #4180 (closed)