Reduce memory leak

Signed-off-by: Dawid Pakuła <zulus@w3des.net>