[NFC] Fix leak in command options configuration.
authorJordan Rupprecht <rupprecht@google.com>
Fri, 9 Dec 2022 00:37:43 +0000 (16:37 -0800)
committerJordan Rupprecht <rupprecht@google.com>
Fri, 9 Dec 2022 00:37:43 +0000 (16:37 -0800)
commit23f145daa50c3f51a7fb8c8d68c55e5f4a8027c2
treea88014e7a61ad686fcacb5813df8cfaac16363a1
parent3b14862f0a968dc079530acbce4f2ca4aa7c1492
[NFC] Fix leak in command options configuration.

`m_options.Append(new OptionPermissions())` leaks because the pointer passed in is not owned. Use a class member to ensure lifetime, which is the common pattern used for this API.

Found by the LLDB command interpreter fuzzer. The fuzz input is running `ap $` twice.
lldb/source/Commands/CommandObjectPlatform.cpp