autoconfig: don't call closedir() when opendir() failed

If opendir() fails, return from matchDriverFromFiles() immediately.
Ubuntu bug 217647.
This commit is contained in:
Julien Cristau 2008-04-22 23:50:11 +02:00
parent 76381092e8
commit fbad87f2ae

View File

@ -330,7 +330,9 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
int i, j;
idsdir = opendir(PCI_TXT_IDS_PATH);
if (idsdir) {
if (!idsdir)
return;
xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", PCI_TXT_IDS_PATH);
direntry = readdir(idsdir);
/* Read the directory */
@ -408,7 +410,6 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
}
direntry = readdir(idsdir);
}
}
end:
xfree(line);
closedir(idsdir);