summaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'print.c')
-rw-r--r--print.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/print.c b/print.c
index 98d31094e..0caa0da74 100644
--- a/print.c
+++ b/print.c
@@ -103,6 +103,10 @@ static int print_supported_chips(void)
} while (1);
s = flashbuses_to_text(chip->bustype);
+ if (s == NULL) {
+ msg_gerr("Out of memory!\n");
+ return 1;
+ }
maxtypelen = max(maxtypelen, strlen(s));
free(s);
}
@@ -265,6 +269,12 @@ static int print_supported_chips(void)
msg_ginfo(" ");
s = flashbuses_to_text(chip->bustype);
+ if (s == NULL) {
+ msg_gerr("Out of memory!\n");
+ free(ven);
+ free(dev);
+ return 1;
+ }
msg_ginfo("%s", s);
for (i = strlen(s); i < maxtypelen; i++)
msg_ginfo(" ");