config: fix the s1 string handling (coverity)

This commit is contained in:
Jaroslav Kysela 2014-10-03 18:44:38 +02:00
parent 3b5f981364
commit be55658b02

View file

@ -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);
}
}
}