Skip to content
Browse files

Fix a possible but insignificant leak in MythArchive's VideoSelector:…

…:getVideoListFromDB(). Coverity defect 703764
  • Loading branch information...
1 parent d314019 commit 18d0a1c3b63475dd0c27c2e83be9bf46f173cf02 @stuartm stuartm committed
Showing with 6 additions and 9 deletions.
  1. +6 −9 mythplugins/mytharchive/mytharchive/videoselector.cpp
View
15 mythplugins/mytharchive/mytharchive/videoselector.cpp
@@ -411,14 +411,13 @@ vector<VideoInfo *> *VideoSelector::getVideoListFromDB(void)
}
}
- vector<VideoInfo*> *videoList = new vector<VideoInfo*>;
-
query.prepare("SELECT intid, title, plot, length, filename, coverfile, "
"category, showlevel, subtitle, season, episode "
"FROM videometadata ORDER BY title,season,episode");
if (query.exec() && query.size())
{
+ vector<VideoInfo*> *videoList = new vector<VideoInfo*>;
QString artist, genre, episode;
while (query.next())
{
@@ -449,14 +448,12 @@ vector<VideoInfo *> *VideoSelector::getVideoListFromDB(void)
info->category = "(None)";
videoList->push_back(info);
}
+ return videoList;
}
- else
- {
- LOG(VB_GENERAL, LOG_ERR, "VideoSelector: Failed to get any video's");
- return NULL;
- }
-
- return videoList;
+
+
+ LOG(VB_GENERAL, LOG_ERR, "VideoSelector: Failed to get any video's");
+ return NULL;
}
void VideoSelector::getVideoList(void)

0 comments on commit 18d0a1c

Please sign in to comment.
Something went wrong with that request. Please try again.