device-manager: Add a sanity check for reading entries

There is code elsewhere that assumes that if user_set_description is
true, then the description is non-NULL.
This commit is contained in:
Tanu Kaskinen 2013-06-04 20:42:48 +03:00
parent 491c6a3a0b
commit 67132eea1a

View file

@ -304,6 +304,11 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
goto fail;
}
if (e->user_set_description && !description) {
pa_log("Entry has user_set_description set, but the description is NULL.");
goto fail;
}
e->description = pa_xstrdup(description);
e->icon = pa_xstrdup(icon);