From: <cha...@us...> - 2008-03-28 13:44:09
|
Revision: 429 http://sipp.svn.sourceforge.net/sipp/?rev=429&view=rev Author: charlespwright Date: 2008-03-28 06:44:06 -0700 (Fri, 28 Mar 2008) Log Message: ----------- Fix: Do not malloc(0) if there are no variables. Modified Paths: -------------- sipp/trunk/variables.cpp Modified: sipp/trunk/variables.cpp =================================================================== --- sipp/trunk/variables.cpp 2008-03-28 02:31:32 UTC (rev 428) +++ sipp/trunk/variables.cpp 2008-03-28 13:44:06 UTC (rev 429) @@ -194,6 +194,10 @@ count = 1; this->size = size; + if (size == 0) { + variableTable = NULL; + return; + } variableTable = (CCallVariable **)malloc(size * sizeof(CCallVariable *)); if (!variableTable) { ERROR("Could not allocate variable table!"); @@ -218,6 +222,10 @@ assert(this->parent); } this->size = src->size; + if (size == 0) { + variableTable = NULL; + return; + } variableTable = (CCallVariable **)malloc(size * sizeof(CCallVariable *)); if (!variableTable) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |