Permalink
Browse files

Updated msSDELayerFreeItemInfo() to make sure the layerinfo struct is…

… allocated before freeing. (#4521/#4700)
  • Loading branch information...
1 parent f004db1 commit fcc56a760fc517a59eea4f7aa0dd77bf79e1acec @sdlime sdlime committed Aug 13, 2013
Showing with 3 additions and 5 deletions.
  1. +3 −5 mapsde.c
View
@@ -2090,16 +2090,14 @@ void msSDELayerFreeItemInfo(layerObj *layer)
msSDELayerInfo *sde = NULL;
int i;
if (!msSDELayerIsOpen(layer)) {
- msSetError( MS_SDEERR,
- "SDE layer has not been opened.",
- "msSDELayerFreeItemInfo()");
+ msSetError( MS_SDEERR, "SDE layer has not been opened.", "msSDELayerFreeItemInfo()");
}
sde = layer->layerinfo;
- if (sde->basedefs) {
+ if (sde != NULL && sde->basedefs) {
SE_table_free_descriptions(sde->basedefs);
sde->basedefs = NULL;
}
- if (sde->joindefs) {
+ if (sde != NULL && sde->joindefs) {
SE_table_free_descriptions(sde->joindefs);
sde->joindefs = NULL;
}

0 comments on commit fcc56a7

Please sign in to comment.