SICKAG / sick_safetyscanners_base

CPP (C++) Driver for SICK safety laser scanners
https://www.sick.com/de/en/opto-electronic-protective-devices/safety-laser-scanners/c/g187225
Apache License 2.0
14 stars 32 forks source link

Fix memory leak in createAndExecuteCommand #7

Closed Kooiman closed 3 years ago

Kooiman commented 3 years ago

Hello!

I was working with this library in a project and noticed that there is a memory leak in createAndExecuteCommand: the command is allocated on the heap and never deleted.

It's a slow leak, but the fix is simple enough. I tested this on my system (Ubuntu 18.04, MS3 Pro 5.5 meter) and verified I could still receive UDP and send/receive TCP data with this change.

lenpuc commented 3 years ago

Hi, thanks for spotting this. Looks good, however I will test it before merging, this will take a couple of days.