Skip to content

Commit

Permalink
Add check for NULL msGMLGetItems
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Mar 23, 2019
1 parent 8f6dd81 commit f6d40c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mapscript/swiginc/layer.i
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,11 @@ available, and the first item is index zero."
if (i >= 0 && i < self->numitems) {
gmlItemListObj *item_list;
item_list = msGMLGetItems(self, "G");
gmlItemObj *item = item_list->items + i;
itemType = msStrdup(item->type);
msGMLFreeItems(item_list); // destroy the original list
if (item_list != NULL) {
gmlItemObj *item = item_list->items + i;
itemType = msStrdup(item->type);
msGMLFreeItems(item_list); // destroy the original list
}
}

return itemType;
Expand Down

0 comments on commit f6d40c8

Please sign in to comment.