diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 39bf8ace8..14c555b87 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -1243,7 +1243,10 @@ QMimeData *Playlist::mimeData(const QModelIndexList &indexes) const { } QBuffer buf; - if (!buf.open(QIODevice::WriteOnly)) return nullptr; + if (!buf.open(QIODevice::WriteOnly)) { + delete mimedata; + return nullptr; + } QDataStream stream(&buf); const Playlist *self = this;