Skip to content

Commit

Permalink
d.linegraph: Fix null pointer issue in qsort call (OSGeo#3878)
Browse files Browse the repository at this point in the history
* Fix null pointer issue in qsort call in d.linegraph

* Fix formatting issue in d.linegraph

* Fixing formatting issue in d.linegraph

---------

Co-authored-by: Shubham Vasudeo Desai <[email protected]>
  • Loading branch information
ShubhamDesai and Shubham Vasudeo Desai authored Jun 23, 2024
1 parent 3f30f1b commit 3f124c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion display/d.linegraph/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ static char *icon_files(void)

closedir(dir);

qsort(list, count, sizeof(char *), cmp);
if (list != NULL) {
qsort(list, count, sizeof(char *), cmp);
}

if (len > 0) {
ret = G_malloc((len + 1) * sizeof(char)); /* \0 */
Expand Down

0 comments on commit 3f124c5

Please sign in to comment.