# HG changeset patch # User nicodvb # Date 1240386057 0 # Node ID ec2408d48b85d282b085958a8e1c9908fc61d2c2 # Parent a70f79850e5fed990b46738be6571ec44cbd33aa in dvdnav_describe_chapters() ifo could be leaked in case of erros; fixed by Erik Hovland diff -r a70f79850e5f -r ec2408d48b85 searching.c --- a/searching.c Mon Feb 02 22:55:58 2009 +0000 +++ b/searching.c Wed Apr 22 07:40:57 2009 +0000 @@ -551,7 +551,7 @@ uint16_t parts, i; title_info_t *ptitle = NULL; ptt_info_t *ptt = NULL; - ifo_handle_t *ifo; + ifo_handle_t *ifo = NULL; pgc_t *pgc; cell_playback_t *cell; uint64_t length, *tmp=NULL; @@ -571,6 +571,7 @@ ifo = vm_get_title_ifo(this->vm, title); if(!ifo || !ifo->vts_pgcit) { printerr("Couldn't open IFO for chosen title, exit."); + retval = 0; goto fail; } @@ -611,11 +612,14 @@ } *duration = length; vm_ifo_close(ifo); + ifo = NULL; retval = parts; *times = tmp; fail: pthread_mutex_unlock(&this->vm_lock); + if(!retval && ifo) + vm_ifo_close(ifo); if(!retval && tmp) free(tmp); return retval;