summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-03-11 23:35:08 +0100
committerCarl Hetherington <cth@carlh.net>2022-04-02 22:24:09 +0200
commit95384a6c1036a1ee2b8ec43e42a77bf1bba54841 (patch)
tree7a68cc533bfd390e4cb506e500cef2c1019339f3 /src/lib
parent421adbf55beb48634566d6c357046878fdde0f8e (diff)
Slightly improve behaviour under low memory conditions.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/emailer.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/emailer.cc b/src/lib/emailer.cc
index f5812f0c2..f906f5a8b 100644
--- a/src/lib/emailer.cc
+++ b/src/lib/emailer.cc
@@ -161,8 +161,14 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str
"Content-Disposition: attachment; filename=" + i.name + "\r\n\r\n";
auto b64 = BIO_new (BIO_f_base64());
+ if (!b64) {
+ throw std::bad_alloc();
+ }
auto bio = BIO_new (BIO_s_mem());
+ if (!bio) {
+ throw std::bad_alloc();
+ }
bio = BIO_push (b64, bio);
ArrayData data (i.file);