Skip to content

Commit

Permalink
Fix a possible but insignificant leak in MythArchive's VideoSelector:…
Browse files Browse the repository at this point in the history
…:getVideoListFromDB(). Coverity defect 703764
  • Loading branch information
stuartm committed Jun 7, 2012
1 parent d314019 commit 18d0a1c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions mythplugins/mytharchive/mytharchive/videoselector.cpp
Expand Up @@ -411,14 +411,13 @@ vector<VideoInfo *> *VideoSelector::getVideoListFromDB(void)
} }
} }


vector<VideoInfo*> *videoList = new vector<VideoInfo*>;

query.prepare("SELECT intid, title, plot, length, filename, coverfile, " query.prepare("SELECT intid, title, plot, length, filename, coverfile, "
"category, showlevel, subtitle, season, episode " "category, showlevel, subtitle, season, episode "
"FROM videometadata ORDER BY title,season,episode"); "FROM videometadata ORDER BY title,season,episode");


if (query.exec() && query.size()) if (query.exec() && query.size())
{ {
vector<VideoInfo*> *videoList = new vector<VideoInfo*>;
QString artist, genre, episode; QString artist, genre, episode;
while (query.next()) while (query.next())
{ {
Expand Down Expand Up @@ -449,14 +448,12 @@ vector<VideoInfo *> *VideoSelector::getVideoListFromDB(void)
info->category = "(None)"; info->category = "(None)";
videoList->push_back(info); videoList->push_back(info);
} }
return videoList;
} }
else
{
LOG(VB_GENERAL, LOG_ERR, "VideoSelector: Failed to get any video's"); LOG(VB_GENERAL, LOG_ERR, "VideoSelector: Failed to get any video's");
return NULL; return NULL;
}

return videoList;
} }


void VideoSelector::getVideoList(void) void VideoSelector::getVideoList(void)
Expand Down

0 comments on commit 18d0a1c

Please sign in to comment.