mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
[BugFix] tagcache_search() must be closed with tagcache_search_finish()
fix a couple of places where this could be left open Change-Id: I43ac7d6b26d728c11f96e5415710341d60f07ab8
This commit is contained in:
parent
a0e95c888d
commit
9af325a541
2 changed files with 7 additions and 0 deletions
|
@ -1218,7 +1218,10 @@ static int create_album_untagged(struct tagcache_search *tcs,
|
|||
{
|
||||
if (rb->button_get(false) > BUTTON_NONE) {
|
||||
if (confirm_quit())
|
||||
{
|
||||
rb->tagcache_search_finish(tcs);
|
||||
return ERROR_USER_ABORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
rb->lcd_clear_display();
|
||||
|
|
|
@ -970,6 +970,7 @@ static int find_index(const char *filename)
|
|||
|
||||
bool tagcache_find_index(struct tagcache_search *tcs, const char *filename)
|
||||
{
|
||||
/* NOTE: on ret==true you need to call tagcache_search_finish(tcs) yourself */
|
||||
int idx_id;
|
||||
|
||||
if (!tc_stat.ready)
|
||||
|
@ -1721,6 +1722,7 @@ static bool build_lookup_list(struct tagcache_search *tcs)
|
|||
|
||||
bool tagcache_search(struct tagcache_search *tcs, int tag)
|
||||
{
|
||||
/* NOTE: call tagcache_search_finish(&tcs) when finished or BAD things may happen (TM) */
|
||||
struct tagcache_header tag_hdr;
|
||||
struct master_header master_hdr;
|
||||
int i;
|
||||
|
@ -3936,6 +3938,7 @@ bool tagcache_create_changelog(struct tagcache_search *tcs)
|
|||
if (clfd < 0)
|
||||
{
|
||||
logf("failure to open changelog");
|
||||
tagcache_search_finish(tcs);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3944,6 +3947,7 @@ bool tagcache_create_changelog(struct tagcache_search *tcs)
|
|||
if ( (tcs->masterfd = open_master_fd(&myhdr, false)) < 0)
|
||||
{
|
||||
close(clfd);
|
||||
tagcache_search_finish(tcs);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue