<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - CuiAboutConfigTabPage::InsertEntry leaks memory"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=112254">112254</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CuiAboutConfigTabPage::InsertEntry leaks memory
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.0.0.0.alpha0+ Master
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Mac OS X (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>telesto@surfxs.nl
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
CuiAboutConfigTabPage::InsertEntry leaks memory with multiple invocations

Steps to Reproduce:
1. Start the Instruments
2. Choose Memory Leak profile tool
3. Select LibreOffice.app in instdir as target process
4. Click on the record button, LODev is started by the profiling tool
5. Wait for the StartCenter to load.
6. Go to LibreOffceDev -> Preferences 
7. Open LibreOffceDev -> Advanced
8. Open Expert Configuration
10. Close the Writer file without saving.
11. Stop recording.
12. Analyse the profile trace.

Actual Results:  
Memory leak in CuiAboutConfigTabPage::InsertEntry at pEntry->SetUserData( new
UserData(rPropertyPath) );


Expected Results:
Shouldn't leak memory


Reproducible: Always

User Profile Reset: No

Additional Info:
The code pointed to by the profile tool is in optaboutconfig.cxx, Line 213 (
4233 Samples) -> pEntry->SetUserData( new UserData(rPropertyPath)


void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, const
OUString& rProp, const OUString& rStatus,
                                        const OUString& rType, const OUString&
rValue, SvTreeListEntry *pParentEntry,
                                        bool bInsertToPrefBox)
{
    SvTreeListEntry* pEntry = new SvTreeListEntry;
    pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(
        Image(), Image(), false)); //It is needed, otherwise causes crash
    pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rProp));
    pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rStatus));
    pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rType));
    pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rValue));
    pEntry->SetUserData( new UserData(rPropertyPath) );

    if(bInsertToPrefBox)
        m_pPrefBox->Insert( pEntry, pParentEntry );
    else
        m_prefBoxEntries.push_back(std::unique_ptr<SvTreeListEntry>(pEntry));


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4)
AppleWebKit/603.1.29 (KHTML, like Gecko) Version/10.1 Safari/603.1.29</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>