Felix Singer has uploaded this change for review.

View Change

jlink_spi.c: Call free() on a pointer only if it's not NULL

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: If3c15b72b44fb94a6c9015fd057867e6fe2ef1ba
---
M jlink_spi.c
1 file changed, 14 insertions(+), 8 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/85/67885/1
diff --git a/jlink_spi.c b/jlink_spi.c
index 2a76a4a..2c9e6cc 100644
--- a/jlink_spi.c
+++ b/jlink_spi.c
@@ -222,10 +222,9 @@
free(param_str);
return 1;
}
+ free(param_str);
}

- free(param_str);
-
int ret;
bool use_serial_number = false;
uint32_t serial_number;
@@ -252,10 +251,9 @@
}

use_serial_number = true;
+ free(param_str);
}

- free(param_str);
-
reset_cs = true;
param_str = extract_programmer_param_str(cfg, "cs");

@@ -269,10 +267,9 @@
free(param_str);
return 1;
}
+ free(param_str);
}

- free(param_str);
-
if (reset_cs)
msg_pdbg("Using RESET as chip select signal.\n");
else
@@ -289,10 +286,9 @@
free(param_str);
return 1;
}
+ free(param_str);
}

- free(param_str);
-
ret = jaylink_init(&jaylink_ctx);

if (ret != JAYLINK_OK) {

To view, visit change 67885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If3c15b72b44fb94a6c9015fd057867e6fe2ef1ba
Gerrit-Change-Number: 67885
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Singer <felixsinger@posteo.net>
Gerrit-MessageType: newchange