Update shelly.cpp

minor updates, leak someplace

==27340== LEAK SUMMARY:
==27340==    definitely lost: 240 bytes in 2 blocks
==27340==    indirectly lost: 0 bytes in 0 blocks
==27340==      possibly lost: 0 bytes in 0 blocks
==27340==    still reachable: 0 bytes in 0 blocks
==27340==         suppressed: 0 bytes in 0 blocks