[libdvdnav-devel] [PATCH 31/33] Don't reassign variable that is already set in loop

beandog at gentoo.org beandog at gentoo.org
Thu Jan 15 21:45:43 CET 2015


From: Steve Dibb <steve.dibb at gmail.com>

---
 src/ifo_read.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ifo_read.c b/src/ifo_read.c
index a6f70a0..38ab6dc 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -2076,11 +2076,11 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
     }
     pgci_ut->lu[i].pgcit = calloc(1, sizeof(pgcit_t));
     if(!pgci_ut->lu[i].pgcit) {
-      unsigned int j;
+      unsigned int j, k;
       for(j = 0; j < i; j++) {
         if(pgci_ut->lu[j].pgcit->pgci_srp) {
-          for(i = 0; i < pgci_ut->lu[j].pgcit->nr_of_pgci_srp; i++) {
-	    ifoFree_PGC(pgci_ut->lu[j].pgcit->pgci_srp[i].pgc);
+          for(k = 0; i < pgci_ut->lu[j].pgcit->nr_of_pgci_srp; k++) {
+	    ifoFree_PGC(pgci_ut->lu[j].pgcit->pgci_srp[k].pgc);
           }
 	  free(pgci_ut->lu[j].pgcit->pgci_srp);
         }
-- 
2.0.4



More information about the libdvdnav-devel mailing list