From: Timo Sirainen Date: Sat, 7 Mar 2020 11:18:48 +0000 (+0200) Subject: lib: istream-base64-encoder - Check i_stream_try_alloc() return value X-Git-Tag: 2.3.11.2~551 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=221810c361fea3052c625c32ed42443762161444;p=thirdparty%2Fdovecot%2Fcore.git lib: istream-base64-encoder - Check i_stream_try_alloc() return value The previous check had identical behavior to this, but this makes static analyzers happier. --- diff --git a/src/lib/istream-base64-encoder.c b/src/lib/istream-base64-encoder.c index fff2fceb27..d285881e56 100644 --- a/src/lib/istream-base64-encoder.c +++ b/src/lib/istream-base64-encoder.c @@ -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,