Skip to content
Snippets Groups Projects
Commit fac9057f authored by Stefan Mahr's avatar Stefan Mahr Committed by Spencer Oliver
Browse files

jtag: parport: avoid freeing read-only memory section


If command parport_cable is not executed, parport_cable points to
const char array in read-only memory as default. On exit free()
will try to free this read-only memory. This patch uses strdup to
allocate memory when defining default setting.

Change-Id: I290e707ac6a37e9dc1b45c85ca51d8bd6aac6761
Signed-off-by: default avatarStefan Mahr <stefan.mahr@sphairon.com>
Reviewed-on: http://openocd.zylin.com/1223


Tested-by: jenkins
Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
parent 02192f6b
Branches
Tags
No related merge requests found
......@@ -268,8 +268,8 @@ static int parport_init(void)
cur_cable = cables;
if ((parport_cable == NULL) || (parport_cable[0] == 0)) {
parport_cable = "wiggler";
if (parport_cable == NULL) {
parport_cable = strdup("wiggler");
LOG_WARNING("No parport cable specified, using default 'wiggler'");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment