ifo might be leaked in the error path.
From: Erik Hovland <erik@hovland.org>
---
mythtv/libs/libmythdvdnav/dvdnav/searching.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/searching.c b/mythtv/libs/libmythdvdnav/dvdnav/searching.c
index d91b52f..dab2ce9 100644
a
|
b
|
uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t |
722 | 722 | uint16_t parts, i; |
723 | 723 | title_info_t *ptitle = NULL; |
724 | 724 | ptt_info_t *ptt = NULL; |
725 | | ifo_handle_t *ifo; |
| 725 | ifo_handle_t *ifo = NULL; |
726 | 726 | pgc_t *pgc; |
727 | 727 | cell_playback_t *cell; |
728 | 728 | uint64_t length, *tmp=NULL; |
… |
… |
uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t |
742 | 742 | ifo = vm_get_title_ifo(this->vm, title); |
743 | 743 | if(!ifo || !ifo->vts_pgcit) { |
744 | 744 | printerr("Couldn't open IFO for chosen title, exit."); |
| 745 | retval = 0; |
745 | 746 | goto fail; |
746 | 747 | } |
747 | 748 | |
… |
… |
uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t |
782 | 783 | } |
783 | 784 | *duration = length; |
784 | 785 | vm_ifo_close(ifo); |
| 786 | ifo = NULL; |
785 | 787 | retval = parts; |
786 | 788 | *times = tmp; |
787 | 789 | |
788 | 790 | fail: |
789 | 791 | pthread_mutex_unlock(&this->vm_lock); |
| 792 | if(!retval && ifo) |
| 793 | vm_ifo_close(ifo); |
790 | 794 | if(!retval && tmp) |
791 | 795 | free(tmp); |
792 | 796 | return retval; |