Permalink
Browse files

Fix memory leaks (#5397)

  • Loading branch information...
szekerest committed Feb 21, 2017
1 parent e85f8e3 commit f1857d439eaf6de59f6df3219828ff0116fd7ed8
Showing with 5 additions and 0 deletions.
  1. +1 −0 mapdraw.c
  2. +4 −0 maphash.c
View
@@ -55,6 +55,7 @@ imageObj *msPrepareImage(mapObj *map, int allow_nonsquare)
return(NULL);
}
msFreeLabelCache(&(map->labelcache));
msInitLabelCache(&(map->labelcache)); /* this clears any previously allocated cache */
/* clear any previously created mask layer images */
View
@@ -187,10 +187,14 @@ int msRemoveHashTable(hashTableObj *table, const char *key)
status = MS_SUCCESS;
if (prev_tp) {
prev_tp->next = tp->next;
msFree(tp->key);
msFree(tp->data);
free(tp);
break;
} else {
table->items[hash(key)] = tp->next;
msFree(tp->key);
msFree(tp->data);
free(tp);
break;
}

0 comments on commit f1857d4

Please sign in to comment.