Mercurial > hg > octave-nkf
changeset 17666:ea1a1eff036d
Plug another memory leak in base64_decode.
* liboctave/util/oct-base64.cc(octave_base64_decode): Free out variable before
calling error handler.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 15 Oct 2013 22:35:15 -0700 |
parents | 78e9bfdc544e |
children | 243116aa0e44 |
files | liboctave/util/oct-base64.cc |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/util/oct-base64.cc +++ b/liboctave/util/oct-base64.cc @@ -38,7 +38,7 @@ size_t outlen = base64_encode_alloc (inc, inlen, out); - if (! *out) + if (! out) { if (outlen == 0 && inlen != 0) (*current_liboctave_error_handler) @@ -74,8 +74,11 @@ else { if ((outlen % (sizeof (double) / sizeof (char))) != 0) - (*current_liboctave_error_handler) - ("base64_decode: incorrect input size"); + { + ::free (out); + (*current_liboctave_error_handler) + ("base64_decode: incorrect input size"); + } else { octave_idx_type len = (outlen * sizeof (char)) / sizeof (double);