card-restore: Handle reading NULL profile name from the database.

It's assumed in a couple of places that entry_read()
initializes entry->profile to a non-NULL string. This patch
makes those assumptions hold.

Tested-by: Mikel Astiz <mikel.astiz.oss@gmail.com>
This commit is contained in:
Tanu Kaskinen 2012-06-30 13:00:25 +03:00
parent 758e5bc28e
commit cec6b153b7

View file

@ -223,6 +223,9 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
goto fail;
}
if (!profile)
profile = "";
e->profile = pa_xstrdup(profile);
if (e->version >= 2) {