From 73f866e7ebaf11f855d255649b5f57d6d19f541c Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 1 Nov 2012 00:24:08 +0100 Subject: 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. --- timeline/tl_matroska.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'timeline') diff --git a/timeline/tl_matroska.c b/timeline/tl_matroska.c index 30694fff24..9387201866 100644 --- a/timeline/tl_matroska.c +++ b/timeline/tl_matroska.c @@ -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; -- cgit v1.2.3