mapserver/mapserver — pull request #4685 by homme (2013-07-04 09:31:09+00:00)
Title: Fix a memory leak in `freeClass()` exposed by valgrind's memcheck

In `msGrowClassLabels()` memory is assigned to
`class->labels[class->numlabels]` but was only freed to
`class->numstyles-1` in `freeClass()`. This fix ensures the last
label is freed.

The valgrind error was in the form:

```
406 (400 direct, 6 indirect) bytes in 1 blocks are definitely lost in loss record 233 of 321
at 0x402A629: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
by 0x54E20D9: msGrowClassLabels (mapfile.c:3420)
by 0x54E274A: loadClass (mapfile.c:3482)
by 0x54E4F43: loadLayer (mapfile.c:4149)
by 0x54ED8F9: loadMapInternal (mapfile.c:6225)
by 0x54EDFF0: msLoadMapFromString (mapfile.c:6362)
...
```