tl_matroska: fix NULL pointer issue

Found by clang analyzer. Probably doesn't matter in practice, because
the number of entries was 0 when entries was NULL.
This commit is contained in:
wm4 2012-11-01 00:24:08 +01:00
parent 0212d7e804
commit 73f866e7eb
1 changed files with 2 additions and 1 deletions

View File

@ -103,7 +103,8 @@ static char **find_files(const char *original_file, const char *suffix)
}
closedir(dp);
// NOTE: maybe should make it compare pointers instead
qsort(entries, num_results, sizeof(struct find_entry), cmp_entry);
if (entries)
qsort(entries, num_results, sizeof(struct find_entry), cmp_entry);
results = talloc_realloc(NULL, results, char *, num_results);
for (int i = 0; i < num_results; i++) {
results[i] = entries[i].name;