diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-11 23:35:08 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-17 22:20:33 +0100 |
| commit | 07f3f6c956e01d30427c502c0af7c66c8441be5c (patch) | |
| tree | 78d7cc0191c0c27bc5c21712e843d8cc39dbcff6 /src | |
| parent | f1f30972e5d1dee08a607a05b6d782540c11595e (diff) | |
Slightly improve behaviour under low memory conditions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/emailer.cc | 6 |
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); |
