]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream-base64-encoder - Check i_stream_try_alloc() return value
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 7 Mar 2020 11:18:48 +0000 (13:18 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 7 Mar 2020 11:18:48 +0000 (13:18 +0200)
The previous check had identical behavior to this, but this makes static
analyzers happier.

src/lib/istream-base64-encoder.c

index fff2fceb27835ba7cb9046ac5e6080cc4defd3f9..d285881e5666fa4e96b8566d1a3f2b47f4de9b37 100644 (file)
@@ -72,8 +72,7 @@ i_stream_base64_finish_encode(struct base64_encoder_istream *bstream)
                return 1;
        }
 
-       i_stream_try_alloc(stream, out_size, &buffer_avail);
-       if (buffer_avail == 0)
+       if (!i_stream_try_alloc(stream, out_size, &buffer_avail))
                return -2;
 
        buffer_create_from_data(&buf, stream->w_buffer + stream->pos,