bugfix:freeing uninitialized pointer