dict_attr_free should check pointer value