fix a few memory leaks in polylib
i found a few memory leaks in polylib (using cppcheck) and fixed them. While at it, i also removed the double line breaks (probably accidentally) introduced seven years ago, which made the code terrible to read.
Edited by Kilian Lackhove