Skip to content

Commit 266b7f8

Browse files
committed
Squashed 'scripts/kconfig/' changes from 24b4fc2..be6ba4d
be6ba4d confdata: Add error path in conf_value_to_yaml git-subtree-dir: scripts/kconfig git-subtree-split: be6ba4db2de5f4fbf98e72b393099f373a7e2ea7
1 parent 4fd2464 commit 266b7f8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

confdata.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -669,14 +669,16 @@ static char *conf_value_to_yaml(struct symbol *sym, const char *val)
669669
yaml_value = strdup(val);
670670
break;
671671
case S_HEX:
672-
asprintf(&yaml_value, "0x%s", val);
673-
break;
674-
case S_STRING:
675-
/* Wrap strings in quotes */
676-
asprintf(&yaml_value, "\"%s\"", val);
677-
break;
678-
case S_BOOLEAN:
679-
case S_TRISTATE:
672+
if (asprintf(&yaml_value, "0x%s", val) < 0)
673+
return NULL;
674+
break;
675+
case S_STRING:
676+
/* Wrap strings in quotes */
677+
if (asprintf(&yaml_value, "\"%s\"", val) < 0)
678+
return NULL;
679+
break;
680+
case S_BOOLEAN:
681+
case S_TRISTATE:
680682
if (strcmp(val, "y") == 0)
681683
yaml_value = strdup("True");
682684
else if (strcmp(val, "n") == 0)

0 commit comments

Comments
 (0)