Initialize m_metaData
ClosedPublic

Authored by broulik on Dec 4 2018, 4:05 PM.

Details

Summary

A new KFileMetaData::UserMetaData is only created when a single file is selected.
If more files are selected, we will call delete on garbage memory in the destructor and crash.
Calling delete on a nullptr is safe.

BUG: 401733

Test Plan
  • Selected multiple files, opened context menu, closed context menu, no crash
  • Selected single file, opened context menu, Tags menu still worked

This feature is only in master, not 18.12, right?

Diff Detail

Repository
R824 Baloo Widgets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Dec 4 2018, 4:05 PM
Restricted Application added a project: Baloo. · View Herald TranscriptDec 4 2018, 4:05 PM
Restricted Application added a subscriber: Baloo. · View Herald Transcript
broulik requested review of this revision.Dec 4 2018, 4:05 PM
broulik edited the summary of this revision. (Show Details)
elvisangelaccio accepted this revision.Dec 4 2018, 9:22 PM
elvisangelaccio added a subscriber: elvisangelaccio.

Ops, I just submitted D17363, but this fix is indeed better.

This revision is now accepted and ready to land.Dec 4 2018, 9:22 PM

And yes, this happens only in master, not 18.12

This revision was automatically updated to reflect the committed changes.