diff --git a/src/config.c b/src/config.c index 5cbdc85d..81acfb2f 100644 --- a/src/config.c +++ b/src/config.c @@ -787,12 +787,15 @@ config_modify_dvr_log( htsmsg_t *c, uint32_t id, const char *uuid, const void *a if ((s1 = htsmsg_get_str(c, "autorec")) != NULL) { s1 = strdup(s1); htsmsg_delete_field(c, "autorec"); - HTSMSG_FOREACH(f, list) { - if (!(e = htsmsg_field_get_map(f))) continue; - if (strcmp(s1, htsmsg_get_str(e, "id") ?: "") == 0) { - htsmsg_add_str(c, "autorec", htsmsg_get_str(e, "uuid")); - break; + if (s1 != NULL) { + HTSMSG_FOREACH(f, list) { + if (!(e = htsmsg_field_get_map(f))) continue; + if (strcmp(s1, htsmsg_get_str(e, "id") ?: "") == 0) { + htsmsg_add_str(c, "autorec", htsmsg_get_str(e, "uuid")); + break; + } } + free((char *)s1); } } }