[z2178] Fix hidden memleak with waypoints

Thanks to rsa for pointing

(based on commit [12260] - eeff1c0)

(based on commit [s1811] - 0339573)