transport: fix memleaks in error paths
This commit is contained in:
parent
c118a684b4
commit
5c9648fb23
|
@ -286,6 +286,7 @@ transport_t ftdi_open(const char *devpath,
|
||||||
|
|
||||||
if (open_device(tr, dev, baud_rate) < 0) {
|
if (open_device(tr, dev, baud_rate) < 0) {
|
||||||
printc_err("ftdi: failed to open device\n");
|
printc_err("ftdi: failed to open device\n");
|
||||||
|
free(tr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,7 @@ transport_t rf2500_open(const char *devpath, const char *requested_serial)
|
||||||
|
|
||||||
if (open_device(tr, dev) < 0) {
|
if (open_device(tr, dev) < 0) {
|
||||||
printc_err("rf2500: failed to open RF2500 device\n");
|
printc_err("rf2500: failed to open RF2500 device\n");
|
||||||
|
free(tr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -605,6 +605,7 @@ transport_t ti3410_open(const char *devpath, const char *requested_serial)
|
||||||
|
|
||||||
if (open_device(tr, dev) < 0) {
|
if (open_device(tr, dev) < 0) {
|
||||||
printc_err("ti3410: failed to open TI3410 device\n");
|
printc_err("ti3410: failed to open TI3410 device\n");
|
||||||
|
free(tr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue