diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-09-10 19:11:27 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-09-10 19:11:27 +0200 |
commit | 7e9455b3b15671ff99ed168638c405e2acedb6df (patch) | |
tree | 444e59ece236e09dc153f665e42160aeb0208c24 /backend/gt68xx_mid.c | |
parent | bc8a517abd2e11e1435f4ef042cfcc8648b62ef7 (diff) | |
parent | bce41b3c37c2a68e7dab234ce0247755a61ceb40 (diff) |
Merge branch 'release/debian/1.0.31-1_experimental1' into masterdebian/1.0.31-1_experimental1
Diffstat (limited to 'backend/gt68xx_mid.c')
-rw-r--r-- | backend/gt68xx_mid.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backend/gt68xx_mid.c b/backend/gt68xx_mid.c index 0d5cbe4..1d6a5c6 100644 --- a/backend/gt68xx_mid.c +++ b/backend/gt68xx_mid.c @@ -1006,6 +1006,7 @@ gt68xx_line_reader_new (GT68xx_Device * dev, DBG (3, "gt68xx_line_reader_new: cannot allocate line buffers: %s\n", sane_strstatus (status)); free (reader); + reader = NULL; return status; } @@ -1105,6 +1106,7 @@ gt68xx_line_reader_new (GT68xx_Device * dev, reader->params.depth); gt68xx_line_reader_free_delays (reader); free (reader); + reader = NULL; return SANE_STATUS_UNSUPPORTED; } @@ -1119,6 +1121,7 @@ gt68xx_line_reader_new (GT68xx_Device * dev, DBG (3, "gt68xx_line_reader_new: cannot allocate pixel buffer\n"); gt68xx_line_reader_free_delays (reader); free (reader); + reader = NULL; return SANE_STATUS_NO_MEM; } @@ -1135,6 +1138,7 @@ gt68xx_line_reader_new (GT68xx_Device * dev, free (reader->pixel_buffer); gt68xx_line_reader_free_delays (reader); free (reader); + reader = NULL; return status; } @@ -1150,6 +1154,13 @@ gt68xx_line_reader_free (GT68xx_Line_Reader * reader) DBG (6, "gt68xx_line_reader_free: enter\n"); + if (reader == NULL) + { + DBG (3, "gt68xx_line_reader_free: already freed\n"); + DBG (6, "gt68xx_line_reader_free: leave\n"); + return SANE_STATUS_INVAL; + } + gt68xx_line_reader_free_delays (reader); if (reader->pixel_buffer) @@ -1167,6 +1178,7 @@ gt68xx_line_reader_free (GT68xx_Line_Reader * reader) } free (reader); + reader = NULL; DBG (6, "gt68xx_line_reader_free: leave\n"); return status; |