summaryrefslogtreecommitdiff
path: root/cbtable.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2014-11-01 23:12:33 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2014-11-01 23:12:33 +0000
commitc0c1cc537661a6aeb2da8104a1bd922ec248a5c7 (patch)
treeb7f1fc04192c584cd02bdf6f1546b2e36ab61a65 /cbtable.c
parentca7b823b13b700d3b92653c9c697084469426fc5 (diff)
downloadflashrom-c0c1cc537661a6aeb2da8104a1bd922ec248a5c7.tar.gz
cbtable.c: Do not unnecessarily duplicate strings.
The strdup calls were a leftover that slipped through the cleanup in r1577. Found-by: Valgrind 3.10.0 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1854 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'cbtable.c')
-rw-r--r--cbtable.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/cbtable.c b/cbtable.c
index c100bbb..1a74e46 100644
--- a/cbtable.c
+++ b/cbtable.c
@@ -40,8 +40,6 @@ static char *cb_vendor = NULL, *cb_model = NULL;
*/
int cb_check_image(uint8_t *image, int size)
{
- const char *image_vendor = NULL;
- const char *image_model = NULL;
unsigned int *walk;
unsigned int mb_part_offset, mb_vendor_offset;
char *mb_part, *mb_vendor;
@@ -83,22 +81,20 @@ int cb_check_image(uint8_t *image, int size)
msg_pdbg("coreboot last image size (not ROM size) is %d bytes.\n", *walk);
- image_vendor = strdup(mb_vendor);
- image_model = strdup(mb_part);
- msg_pdbg("Manufacturer: %s\n", image_vendor);
- msg_pdbg("Mainboard ID: %s\n", image_model);
+ msg_pdbg("Manufacturer: %s\n", mb_vendor);
+ msg_pdbg("Mainboard ID: %s\n", mb_part);
/* If these are not set, the coreboot table was not found. */
if (!cb_vendor || !cb_model)
return 0;
/* These comparisons are case insensitive to make things a little less user^Werror prone. */
- if (!strcasecmp(image_vendor, cb_vendor) && !strcasecmp(image_model, cb_model)) {
+ if (!strcasecmp(mb_vendor, cb_vendor) && !strcasecmp(mb_part, cb_model)) {
msg_pdbg2("This coreboot image matches this mainboard.\n");
} else {
msg_perr("This coreboot image (%s:%s) does not appear to\n"
"be correct for the detected mainboard (%s:%s).\n",
- image_vendor, image_model, cb_vendor, cb_model);
+ mb_vendor, mb_part, cb_vendor, cb_model);
return -1;
}