Mercurial > octave
diff liboctave/numeric/oct-fftw.cc @ 26369:0249ba4c9589
Fix static analyzer detected V668 issues (bug #55347).
This patch adresses all V668 (check return value of "new"
against NULL) except the following files:
utils.cc:188 (keep the check in expression for clarity)
* file-editor.cc, resource-manager.cc, shortcut-manager.cc, display.cc,
file-editor-tab.cc, ft-text-renderer.cc, graphics.cc, oct-errno.in.cc,
pager.cc, __init_fltk__.cc, audiodevinfo.cc, oct-parse.yy, oct-fftw.cc,
oct-rand.cc, oct-spparms.cc, oct-env.cc, singleton-cleanup.cc:
Remove checking for nullptr when pointer was created with new() which will
throw an exception.
author | Andreas Weber <octave@josoansi.de> |
---|---|
date | Wed, 02 Jan 2019 14:13:59 +0100 |
parents | 8c72f0345ee8 |
children | fff643eb3514 |
line wrap: on
line diff
--- a/liboctave/numeric/oct-fftw.cc Tue Jan 01 22:24:53 2019 -0800 +++ b/liboctave/numeric/oct-fftw.cc Wed Jan 02 14:13:59 2019 +0100 @@ -112,15 +112,9 @@ if (! instance) { instance = new fftw_planner (); - - if (instance) - singleton_cleanup_list::add (cleanup_instance); + singleton_cleanup_list::add (cleanup_instance); } - if (! instance) - (*current_liboctave_error_handler) - ("unable to create fftw_planner object!"); - return retval; } @@ -472,15 +466,9 @@ if (! instance) { instance = new float_fftw_planner (); - - if (instance) - singleton_cleanup_list::add (cleanup_instance); + singleton_cleanup_list::add (cleanup_instance); } - if (! instance) - (*current_liboctave_error_handler) - ("unable to create fftw_planner object!"); - return retval; }