CID 605799: Resource Leakage in fortune

This commit is contained in:
Philippe Saint-Pierre
2015-06-25 18:03:41 -04:00
parent 94817d608d
commit c5666be3b8
+3 -2
View File
@@ -37,9 +37,10 @@ choose_file(const char *path)
count++;
}
if (count == 0)
if (count == 0) {
closedir(dir);
return -1;
}
// choose and open entry
chosen = rand() % count;