Coverity report:
CID 1366758: Memory - corruptions (USE_AFTER_FREE)
Calling "operator delete[]" frees pointer "label32"
which has already been freed.
Commit f60ff4d575 fixed several memory leaks
but also added this wrong delete operation.
label32 is assigned to char_samp->label32_, so it is freed when deleting
char_samp.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It is not necessary to check for null pointers after new.
Simplify also two delete operations which were missing
in the previous commit.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164722 (#9 of 9): Resource leak (RESOURCE_LEAK)
20. leaked_storage: Variable label32 going out of scope leaks the storage
it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>