diff options
Diffstat (limited to 'auto-virtserial-guest.c')
-rw-r--r-- | auto-virtserial-guest.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/auto-virtserial-guest.c b/auto-virtserial-guest.c index b0faa10..cef1d26 100644 --- a/auto-virtserial-guest.c +++ b/auto-virtserial-guest.c @@ -153,7 +153,9 @@ static int open_port(int nr) buf = get_port_dev(nr); if (!buf) return -ENOMEM; - fd = open(get_port_dev(nr), O_RDWR); + fd = open(buf, O_RDWR); + free(buf); + if (fd == -1) return -errno; g_fd = fd; |