diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2016-08-09 13:56:57 -0400 |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2016-08-09 14:03:24 -0400 |
commit | 477931228e4782d92745c7706e54cbbcd8818741 (patch) | |
tree | e90dbad908ce7de6a9b4e38dba15ef5466490e25 | |
parent | 4fa2dce767c98f3d699f4c71de5bacc661ab1fde (diff) | |
download | swig-477931228e4782d92745c7706e54cbbcd8818741.tar.gz |
Fix maybe-uninitialized pointer
Explicitly initialize the SwigPtr in SWIG_Matlab_NewPointerObj to null.
This fixes a -wmaybe-uninitialized warning, because the pointer may or
may not be initialized by SWIG_Matlab_NewPointer, and is used later in
the function.
-rw-r--r-- | Lib/matlab/matlabrun.swg | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/matlab/matlabrun.swg b/Lib/matlab/matlabrun.swg index 539741b88..553e5fb0c 100644 --- a/Lib/matlab/matlabrun.swg +++ b/Lib/matlab/matlabrun.swg @@ -182,7 +182,7 @@ SWIGRUNTIME mxArray* SWIG_Matlab_NewPointerObj(void *ptr, swig_type_info *type, int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; /* Allocate a pointer object */ - SwigPtr* swig_ptr; + SwigPtr* swig_ptr = 0; if (SWIG_Matlab_NewPointer(&swig_ptr, ptr, type, own)) { mexErrMsgIdAndTxt("SWIG:NewPointerObj","Cannot allocate pointer"); } |