diff
- 	free(sm_alternate);
- 	free(error_strategy);
+ 	if (sm_alternate)
+ 		free(sm_alternate);
+ 	if (error_strategy)
+ 		free(error_strategy);
