error:
sfm_close (r_);
- dict_destroy (dict);
+ dict_unref (dict);
*dictp = NULL;
return NULL;
}
}
number = text_get_token (text, ss_cstr (" "), NULL);
- if (!strcmp (number, "11"))
+ if (!number)
+ sys_warn (r, record->pos,
+ _("Missing label source value "
+ "following `E' at offset %zu in MRSETS record."),
+ text_pos (text));
+ else if (!strcmp (number, "11"))
mrset->label_from_var_label = true;
else if (strcmp (number, "1"))
sys_warn (r, record->pos,
if (text_match (text, ')'))
break;
}
- if (attrs != NULL)
+ if (attrs != NULL && attribute_get_n_values (attr) > 0)
{
if (!attrset_try_add (attrs, attr))
{
struct variable *var = dict_get_var (dict, i);
struct attrset *attrs = var_get_attributes (var);
const struct attribute *attr = attrset_lookup (attrs, "$@Role");
- if (attr != NULL)
+ if (attr != NULL && attribute_get_n_values (attr) > 0)
{
int value = atoi (attribute_get_value (attr, 0));
enum var_role role;