From e16b0e2051919a78f1873806eb453b30930d8712 Mon Sep 17 00:00:00 2001 From: Alessandro Zummo Date: Fri, 18 Apr 2008 21:24:32 +0000 Subject: [PATCH] backend/epson2.c: fixed attach() error path. --- ChangeLog | 3 +++ backend/epson2.c | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d68d5292..10da5b200 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2008-04-18 Alessandro Zummo + * backend/epson2.c: fixed attach() error path. + 2008-04-14 Nicolas Martin * backend/pixma_mp150.c, backend/pixma.h, backend/pixma_mp150.c doc/sane-pixma.man, doc/descriptions/pixma.desc: diff --git a/backend/epson2.c b/backend/epson2.c index 163ec898f..b6aa06dc9 100644 --- a/backend/epson2.c +++ b/backend/epson2.c @@ -1323,7 +1323,6 @@ attach(const char *name, Epson_Device * *devp, int type) if (status != SANE_STATUS_GOOD) { DBG(1, "%s: inquiry failed: %s\n", __func__, sane_strstatus(status)); - close_scanner(s); goto free; } @@ -1534,8 +1533,6 @@ attach(const char *name, Epson_Device * *devp, int type) dev->need_reset_on_source_change = SANE_TRUE; } - close_scanner(s); - /* we are done with this one, prepare for the next scanner */ num_devices++; dev->next = first_dev; @@ -1545,6 +1542,7 @@ attach(const char *name, Epson_Device * *devp, int type) *devp = dev; free: + close_scanner(s); free(s); return status; }