Mercurial > octave
changeset 26528:9a91f675fd5f stable
oct-rl-hist.c: Fix static analyzer detected issues (bug #55440).
* oct-rl-hist.c (octave_history_list): Calculate size of memory for malloc with
correct type.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sat, 12 Jan 2019 15:49:49 +0100 |
parents | 75c7aafca6bb |
children | 33590cce7019 |
files | liboctave/util/oct-rl-hist.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/util/oct-rl-hist.c Sat Jan 12 08:14:40 2019 -0500 +++ b/liboctave/util/oct-rl-hist.c Sat Jan 12 15:49:49 2019 +0100 @@ -276,7 +276,7 @@ beg = (limit < 0 || end < limit) ? 0 : (end - limit); - retval = malloc ((size_t) (end - beg + 1) * sizeof (char **)); + retval = malloc ((size_t) (end - beg + 1) * sizeof (char *)); // FIXME: Should this call current_liboctave_error_handler instead? if (! retval) return retval;