util/cbi-util: Fix resource leaks
Found-by: Coverity Scan
Commit-Ready: Patrick Georgi
Tested-by: Patrick Georgi
@@ -322,6 +322,7 @@ static int cmd_create(int argc, char **argv)
fprintf(stderr, "Unable to write CBI image to %s\n", filename);
return rv;
}
+ free(cbi);
fprintf(stderr, "CBI image is created successfully\n");
@@ -416,6 +417,8 @@ static int cmd_show(int argc, char **argv)
print_integer(buf, CBI_TAG_OEM_ID);
print_integer(buf, CBI_TAG_SKU_ID);
+ free(buf);
+
printf("Data validated successfully\n");
return 0;
}
