transport: fix memleaks in error paths

This commit is contained in:
Priit Laes 2012-10-26 20:01:29 +03:00 committed by Daniel Beer
parent c118a684b4
commit 5c9648fb23
3 changed files with 3 additions and 0 deletions

View File

@ -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;
} }

View File

@ -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;
} }

View File

@ -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;
} }