title: Receving valgrind error on conditional jump
body: <p>I got this code which creates a 3D ARRAY - more like a 2D array that each cell is a pointer. I'm trying to initialize it to be <code>LENGTH_OF_ROW * SIZE * sizeof(Node)</code>.</p>
  
  <p>This is struct Node:</p>
  
  <pre><code>typedef struct Node
  {
  void * data;
  void *key;
  }Node;
  </code></pre>
  
  <p>and this is the code to creating a hash table:</p>
  
  <pre><code> Node*** createHashTable(size_t size)
   {
   Node ***hashTable = (Node***)malloc(LENGTH_OF_ROW*sizeof(Node**));
   for (int i = 0; i &lt; LENGTH_OF_ROW; i++)
   {
      hashTable[i] = (Node**)malloc(size * sizeof(Node*));
      for (int j = 0; j &lt; (int)size; j++)
      {
          hashTable[i][j] = malloc(sizeof(Node));
          hashTable[i][j]-&gt;key = EMPTY_CELL;
      }
  }
  return hashTable;
  }
  </code></pre>
  
  <p>this is the valgrind error:</p>
  
  <blockquote>
    <p>49427== Conditional jump or move depends on uninitialised value(s)</p>
    
    <p>49427== at 0x4C28BCD: malloc (vg_replace_malloc.c:296)</p>
    
    <p>49427==   by 0x400844: createHashTable (GenericHashTable.c:40)</p>
    
    <p>49427==    by 0x40091B: createTable (GenericHashTable.c:57)</p>
    
    <p>49427==    by 0x4015E5: main (HashIntSearch.c:30)</p>
  </blockquote>
  
  <p>So an error at line 40, 
  this line:  <code>hashTable[i] = (Node**)malloc(size * sizeof(Node*));</code>
  Can't figure out why am I getting this error.</p>
  
  <p>Thanks!</p>
  
  <p>size is defined in main this way: </p>
  
  <pre><code>size_t tableSize;
  int val;
  sscanf(argv[1], "%d",(&amp;tableSize));
  sscanf(argv[2], "%d", &amp;val);
  // Creating a table with addresses of functions.
  TableP table = createTable(tableSize, &amp;cloneInt, &amp;freeInt, &amp;intFcn,
                                          &amp;intPrint, &amp;intPrint, &amp;intCompare);
  </code></pre>
  
  <p>this is createTable:</p>
  
  <pre><code>TableP createTable(size_t tableSize, CloneKeyFcn cloneKey, FreeKeyFcn   freeKey
   , HashFcn hfun, PrintKeyFcn printKeyFun, PrintDataFcn printDataFun
  , ComparisonFcn fcomp)
  {
  TableP table = (TableP)malloc(sizeof(Table));
  table-&gt;multiplicity = 1;
  table-&gt;originalSize = tableSize;
  table-&gt;currentSize = tableSize;
  table-&gt;hashTable = createHashTable(tableSize);
  table-&gt;cloner = cloneKey;
  table-&gt;freer = freeKey;
  table-&gt;hash = hfun;
  table-&gt;keyPrinter = printKeyFun;
  table-&gt;dataPrinter = printDataFun;
  table-&gt;comparer = fcomp;
  return table;
  }
  </code></pre>
  
  <p>I'm running valgrind with size 1 </p>