diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 18:44:51 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 18:44:51 +0200 |
commit | ad38bc6ecb80ddeb562841b33258dd53659b1da6 (patch) | |
tree | e02e9c3ff760554fd87f70df0e18b88594091a48 /backend/gt68xx_mid.c | |
parent | 9c23ed018d72eed2554f4f9cff1ae6e6bb0cd479 (diff) |
New upstream version 1.0.31upstream/1.0.31
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; |