Fix memory leak in d-tor
Remove empty throw specifier from function that can throw
Fix memory leak in error path
Add missing break in switch
Free memory allocated with strdup with free