summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2016-08-09 13:56:57 -0400
committerMatthew Woehlke <matthew.woehlke@kitware.com>2016-08-09 14:03:24 -0400
commit477931228e4782d92745c7706e54cbbcd8818741 (patch)
treee90dbad908ce7de6a9b4e38dba15ef5466490e25
parent4fa2dce767c98f3d699f4c71de5bacc661ab1fde (diff)
downloadswig-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.swg2
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");
}