]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
xmltv_load_grabbers - only call closedir when opendir was successfull 157/head
authorJernej Fijačko <jernej@jernej.org>
Wed, 3 Oct 2012 10:32:16 +0000 (13:32 +0300)
committerJernej Fijačko <jernej@jernej.org>
Wed, 3 Oct 2012 10:32:16 +0000 (13:32 +0300)
I'm working on an android build and it crashes here if opendir returns NULL. Not sure if this is also an issue on other systems.

src/epggrab/module/xmltv.c

index 008e42405bc9336c833c450465d19e6a87db973e..83d050477acf1a180e208138735f33f0b5afcdc2 100644 (file)
@@ -667,8 +667,8 @@ static void _xmltv_load_grabbers ( void )
             free(outbuf);
           }
         }
+        closedir(dir);
       }
-      closedir(dir);
       tmp = strtok(NULL, ":");
     }
     free(path);